如何将图像的base64发送到服务器 [英] how to send image base64 to server
本文介绍了如何将图像的base64发送到服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我用的base64 EN codeD(通过选择图片)动态显示图像。
< IMG风格=宽度:412px; SRC =数据:图像/ GIF; BASE64,R0lGODlhwAAAAXAAACH5BAEAAPwALA
如何发送图像到服务器?由$。阿贾克斯()和不回发。
在此先感谢
解决方案
$。阿贾克斯({
类型:'POST',//或获取
网址:urlToMyServer.aspx,
数据:{IMG:$('IMG')ATTR(SRC)。}
});
如果在B64 is'nt好长好长,只是把它的常规方法是什么?
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
解决方案
$.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 ?
这篇关于如何将图像的base64发送到服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文