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,

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

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 php环境如何实现国密SM2相关功能
  • ¥15 关于#单片机#的问题:K210 例程里面提示我iomem.h: No such file or directory
  • ¥15 LSPI算法的大问题
  • ¥15 java导出word 动态填充数据
  • ¥15 python SSH连接设备使用STD读配置卡死的问题
  • ¥20 扑克的算牌公式及软件制作
  • ¥20 如何通过云图中RPG去计算云图上不同位置的值?
  • ¥15 请问不小心下载到了钓鱼软件怎么办?
  • ¥15 求国博抢票 求国博抢票 有的私
  • ¥50 swiftui @query 报错