weixin_33709590 2017-05-12 10:39 采纳率: 0%
浏览 41

IE 11无法上传Ajax文件

While Chrome, Firefox, Safari working fine, IE 11 fails the following ajax file upload. On IE 11, it tried to upload the image however takes 30+ senonds and finally dies leaving no clue.

My Form

<form action="/upload" method="post" enctype="multipart/form-data">
  <label>Your name</label>
  <input name="uname" type="text" id="uname">

  <label>File1</label>
  <input name="file[]" type="file" id="file1" accept="image/*">

  <label>File2</label>
  <input name="file[]" type="file" id="file2" accept="image/*">

  <button id="btn-submit" type="submit">Submit</button>
</form>

The JS

$('#btn-submit').click(function(e) {
  var formData = new FormData($('form')[0]);

  $.ajax({
    url: '/upload',
    type: 'POST',
    data: formData,
    cache: false,
    contentType: false,
    processData: false,
    success: function() {
      console.log(arguments);
    },
    error: function() {
      console.error(arguments);
    }
  });
});

My NodeJS server has the following in log when IE fails:

POST /upload - - ms - -

When I use Chrome however the server log looks like this:

POST /upload 200 5435.018 ms - 60

Not sure what I am doing wrong! Please help!

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 三菱变频器模块怎么检测触发
    • ¥30 求一下解题思路,完全不懂。
    • ¥30 关于#硬件工程#的问题:求一下解题思路
    • ¥15 运筹学对偶单纯行法构造扩充问题
    • ¥20 XP系统的老电脑一开机就提示找不到rundll.exe,付费求解
    • ¥15 milvus查询出来的score怎么转换成0-1之间的相似性
    • ¥15 lvgl V9移植到linux开发板
    • ¥15 VB.net中在窗体中创建一个button控件来关闭窗体,但是提示错误,我该怎么办
    • ¥15 网上下载好的程序但是arduinoIDE编程报错,运行不了,哪里出错了,能具体给改一下吗
    • ¥15 Sharepoint JS开发 付费技术指导