function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Anjali RAnjali R 

How to save image as an attachment and access the saved image using href or apex:commandLink

Below are the steps :
1. I have an html page where user can perform some drawings.
2. There is a submit button which will convert the html page to base64 encoding using html2canvas.
3. I need to save this image as an attachment and made this available as a downloadable link (download as png image ) in my application.

Please help me !!
ShashankShashank (Salesforce Developers) 
You can save it as an attachment record, and then construct the download URL using the Id of the attachment record.

If the Id of the attachment record is, for example, 01590000003nfWd, and your instance is na2:

Then the download URL will be something like this: