javascript - force download base64 image -


to start js isn’t 1 of strengths. i’ve been trying past couple of days edit js function make force download base64 image. function does, when download button clicked, open new window image on it. user has right click , save picture. i’m trying force download image instead of right click , ‘save as’.

the dataurl produce base4 png string (data:image/jpeg;base64,/9j/4aaqskzjrgabaqaaaqabaad/2wbdaaebaqebaqebaq………)

i tried using suggested in thread didn't work.

all suggestions welcomed. thanks.

savepaint: function() {             var self = this;              dataurl = self.context.canvas.todataurl();              var cntnt = $("<p class='dialogheader'>please right click , select 'save image as' option. click here return</p>           <img id='printimage' src=" + dataurl + ">");             self.newsavedimage.html(cntnt);              self.showpopup(self.newsavedimage, self.canvaswidth, self.canvasheight) } 

finally! got work. facing same problem found function here http://danml.com/download.html let force download base64.


Comments

Popular posts from this blog

python - mat is not a numerical tuple : openCV error -

c# - MSAA finds controls UI Automation doesn't -

wordpress - .htaccess: RewriteRule: bad flag delimiters -