Skip to content

Commit a671a8a

Browse files
author
Ilya Lebedev
committed
fixed append after abort
1 parent e5e7a65 commit a671a8a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/FileAPI.core.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -786,6 +786,7 @@
786786
// Set upload status props
787787
proxyXHR.total = _total;
788788
proxyXHR.loaded = 0;
789+
proxyXHR.filesLeft = dataArray.length;
789790

790791
// emit "beforeupload" event
791792
options.beforeupload(proxyXHR, options);
@@ -798,6 +799,8 @@
798799
, _fileOptions = _simpleClone(options)
799800
;
800801

802+
proxyXHR.filesLeft = dataArray.length;
803+
801804
if( _file && _file.name === api.expando ){
802805
_file = null;
803806
api.log('[warn] FileAPI.upload() — called without files')
@@ -873,7 +876,7 @@
873876

874877

875878
// ...
876-
proxyXHR.abort = function (current){ this.current = current; xhr.abort(); };
879+
proxyXHR.abort = function (current){ dataArray.length = 0; this.current = current; xhr.abort(); };
877880

878881
// Start upload
879882
xhr.send(form);
@@ -901,6 +904,8 @@
901904
}
902905
});
903906

907+
proxyXHR.statusText = "";
908+
904909
if (_complete) {
905910
_nextFile.call(_this);
906911
}

0 commit comments

Comments
 (0)