【问题标题】:While sending base64 image to server in ajax post "/" are getting gconverted to '%'在 ajax 帖子“/”中将 base64 图像发送到服务器时,gconverted 为“%”
【发布时间】:2014-09-19 08:53:50
【问题描述】:

我想将图片作为 base64 上传到服务器。所以我发送这样的请求

$.post(Config.serviceURL('captureImage/' + memid), {
    imageString: imageData
}, function(data) {
    alert("Image uploaded!", data);
}).fail(function() {
    alert("error");
});

imageData 参数包含 base64 字符串。现在的问题是,每当我向服务器发送请求时,base64 中的所有“/”都会被转换为“%”,我不知道为什么会这样。

【问题讨论】:

    标签: jquery ajax image base64 image-uploading


    【解决方案1】:

    我不知道真正的问题是什么,但您可以在服务器上解码 64 imageString 以使斜线恢复正常的“/”。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-02-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-09-17
      相关资源
      最近更新 更多