Reputation: 3061
i'm trying getting binary string of the files but as i can see i'm unable actually, why readAsDataUrl works while readAsBinaryString won't ?
I putted my code in jsbin any help appriciated thanks.
Upvotes: 0
Views: 458
Reputation: 2442
img.src = e.target.result;
Dude, the "src" attribute of an image is a URL, not a string where every character is an int between 0 and 255 !!
You have to use ReadAsArrayBuffer() instead, and then the canvas API to render the ArrayBuffer you have into the context of a canvas.
Edit: If you don't want to show it in an image, but just to Ajax it to your server, here is a solution !
Upvotes: 1