Skip to content

Commit

Permalink
Merge pull request #69 from dolymood/master
Browse files Browse the repository at this point in the history
fix: ie10+ hangs indefinitely on empty file upload
  • Loading branch information
AidasK committed Jan 7, 2015
2 parents 81ef017 + 48c78fb commit f9fbbb2
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

0 comments on commit f9fbbb2

Please sign in to comment.