javascript - Using Phonegap download image and want to convert it into base64 in iOS -


i stuck in problem regarding base64.

the situation - download image in ipad , getting path of download image :-

{"isfile":true,"isdirectory":false,"name":"testimage.png","fullpath":"/testimage.png","filesystem":"","nativeurl":"file:///var/mobile/containers/data/application/4048f634-d44a-40f8-aca0-32bc9f401f56/documents/testimage.png"}

in above object ,nativeurl getting image , able append on html page, want convert base64 ,& not been able till now.

i know somewhere possible. making mistake.
anybody,expert please me sort out issue, if provide example full in online editor.

thanks

shivam

<div id='mainpostdiv'></div>        //hello, need convert base64     // set data first in localstorage      var imagedata = localstorage.getitem("imagedata");     var imgpost = document.createelement('img');     imgpost.setattribute('id', "imgpost");     imgpost.src = "data:image/jpeg;base64," + imagedata;     $('#mainpostdiv').append(imgpost); 

Comments

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -