Convert external image to base64


#1

I have a variable with a url to a jpeg file on a remote server.

Now I want to load the image and convert to base64. Is this possible?

I already have a img tag to show the image in my template view.


#2

you could use FileReader readAsDataUrl
http://docs.phonegap.com/en/2.3.0/cordova_file_file.md.html#FileReader_read_as_data_url


#3

hmm good to know :smile:

I’ll try it …

At this moment I’ve encoded the image on the server as base64 and return to my app.