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
sujin h ssujin h s 

Dynamic progress bar while downloading

I'm trying to download the element in the aura component as image & i'm successfull on it. So now i want to display a dynamic progress bar on clicking "Download" button & the size of the image is vary on time to time. Is it possible to do that?

My code to download image is:

    saveImage: function(data){
        var hiddenElement = document.createElement('a');
        hiddenElement.href = 'data:image/jpg;base64,' + encodeURI(data);
        hiddenElement.target = '_self';  
        hiddenElement.download = 'ExportImage.jpg';  
        document.body.appendChild(hiddenElement);
        hiddenElement.click();
    }
AbhishekAbhishek (Salesforce Developers) 
I think it's possible.

You can use the code as mentioned in the below developer discussion,

https://salesforce.stackexchange.com/questions/102255/while-we-are-uploading-files-to-notes-attachments-i-want-to-show-the-progre


Let me know if it helps you and close your query by marking it as solved so that it can help others in the future.

Thanks.