how to send image base64 to server

天大地大妈咪最大 提交于 2019-12-11 08:01:25

问题


I used base64 encoded to display image dynamically (by select image).

<img style="width: 412px;" src="data:image/gif;base64,R0lGODlhwAAAAXAAACH5BAEAAPwALA

How to send image to a server? by $.ajax() and without postback.

Thanks in advance


回答1:


$.ajax({
    type: 'POST', //or get
    url : 'urlToMyServer.aspx',
    data: { img : $('img').attr('src') }
});

If the B64 is'nt really, really long, just send it the regular way ?



来源:https://stackoverflow.com/questions/13905681/how-to-send-image-base64-to-server

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!