Skip to content

Commit 48c78fb

Browse files
committed
fix ie10+ hangs indefinitely
IE10+, if file's size is 0 then skip the file. I think this is a good way to fix it.
1 parent 9829556 commit 48c78fb

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/flow.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
* @license MIT
33
*/
44
(function(window, document, undefined) {'use strict';
5-
5+
// ie10+
6+
var ie10plus = window.navigator.msPointerEnabled;
67
/**
78
* Flow.js is a library providing multiple simultaneous, stable and
89
* resumable uploads via the HTML5 File API.
@@ -562,9 +563,11 @@
562563
addFiles: function (fileList, event) {
563564
var files = [];
564565
each(fileList, function (file) {
566+
// Uploading empty file IE10/IE11 hangs indefinitely
567+
// see https://connect.microsoft.com/IE/feedback/details/813443/uploading-empty-file-ie10-ie11-hangs-indefinitely
565568
// Directories have size `0` and name `.`
566569
// Ignore already added files
567-
if (!(file.size % 4096 === 0 && (file.name === '.' || file.fileName === '.')) &&
570+
if ((!ie10plus || ie10plus && file.size > 0) && !(file.size % 4096 === 0 && (file.name === '.' || file.fileName === '.')) &&
568571
!this.getFromUniqueIdentifier(this.generateUniqueIdentifier(file))) {
569572
var f = new FlowFile(this, file);
570573
if (this.fire('fileAdded', f, event)) {

0 commit comments

Comments
 (0)