Skip to content

Commit

Permalink
fix ie10+ hangs indefinitely
Browse files Browse the repository at this point in the history
IE10+, if file's size is 0 then skip the file. I think this is a good way to fix it.
  • Loading branch information
dolymood committed Jan 7, 2015
1 parent 9829556 commit 48c78fb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/flow.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
* @license MIT
*/
(function(window, document, undefined) {'use strict';

// ie10+
var ie10plus = window.navigator.msPointerEnabled;
/**
* Flow.js is a library providing multiple simultaneous, stable and
* resumable uploads via the HTML5 File API.
Expand Down Expand Up @@ -562,9 +563,11 @@
addFiles: function (fileList, event) {
var files = [];
each(fileList, function (file) {
// Uploading empty file IE10/IE11 hangs indefinitely
// see https://connect.microsoft.com/IE/feedback/details/813443/uploading-empty-file-ie10-ie11-hangs-indefinitely
// Directories have size `0` and name `.`
// Ignore already added files
if (!(file.size % 4096 === 0 && (file.name === '.' || file.fileName === '.')) &&
if ((!ie10plus || ie10plus && file.size > 0) && !(file.size % 4096 === 0 && (file.name === '.' || file.fileName === '.')) &&
!this.getFromUniqueIdentifier(this.generateUniqueIdentifier(file))) {
var f = new FlowFile(this, file);
if (this.fire('fileAdded', f, event)) {
Expand Down

1 comment on commit 48c78fb

@kalavt
Copy link

@kalavt kalavt commented on 48c78fb Apr 3, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when upload a empty file, event flow::fileAdded fired in chrome but not in IE10+

Please sign in to comment.