weixin_33713503 2017-05-03 14:55 采纳率: 0%
浏览 266

iOS上的JS formdata Chrome

I'm trying to upload images to my server from a WebApp. I'm using Formdata to prepare my data:

var dataView = new DataView(savedImage.value.data);
var blob = new Blob([dataView], { type: savedImage.value.type });

var file = new File([blob], savedImage.value.filename);

var fd = new FormData();
fd.append('filename', obj.filename);
fd.append('data', file);
fd.append('guid', obj.guid);
fd.append('filepath', obj.filepath);

And then I use Jquery to send it:

return $.ajax({
    type: 'POST',
    data: fd,
    processData: false,
    contentType: false,
    url: url,
    async:true,
})

This however does not work on Chrome for iOS(10.3) I don't even get any errors. Can anyone verify this behavior and an alternative way to accomplish this?

This works on Chrome for Desktop

EDIT 1
It seems that it is the creating of a file from a blob that is not supported in Chrome for iOS. Anyone have any experience with this?

Also can anyone tell me why on CanIUse and other sites, there are no specific Chrome for iOS category?

  • 写回答

1条回答 默认 最新

  • weixin_33693070 2019-03-24 00:41
    关注

    Might be too late, but just for anyone else who has the same issue. I had the same problem and fixed by formData.append Blob instead of a File.

    评论

报告相同问题?

悬赏问题

  • ¥15 matlab中mjs用不了
  • ¥15 Ios抖音直播的时候如何添加自定义图片在直播间!
  • ¥60 riscv-pulpino总线上挂载axi从机
  • ¥15 ssh登录页面的问题
  • ¥50 关于在matlab上对曲柄摇杆机构上一点的运动学仿真
  • ¥15 jetson nano
  • ¥15 :app:debugCompileClasspath'.
  • ¥15 windows c++内嵌qt出现数据转换问题。
  • ¥15 stm32 串口通讯过程中的问题
  • ¥20 公众号如何实现点击超链接后自动发送文字