使用圖像文件,我得到的圖像的URL,需要發送到web服務。從那裏,圖像必須保存在我的系統本地。CONVERT圖像URL到Base64
的代碼我使用:
var imagepath = $("#imageid").val();// from this getting the path of the selected image
that var st = imagepath.replace(data:image/png or jpg; base64"/"");
如何將圖像URL轉換爲Base64?
[你如何在JavaScript中將字符串編碼爲Base64?](http://stackoverflow.com/questions/246801/how -can-encode-a-string-to-base64-in-javascript) –
如果你只是想對url進行編碼而不是圖像數據,你可能會在這裏找到你的答案:http://stackoverflow.com/questions/246801/how-can-you-encode-a-string-to-base64-in-javascript –