I need to convert my image to a base64 string so that i can send my image to a server.
Is there any js file for this... ? Else how to convert it
Answer
You can use the HTML5 for it:
Create a canvas, load your image into it and then use toDataURL() to get the base64 representation (actually, it's a data: URL but it contains the base64-encoded image).
No comments:
Post a Comment