File tree Expand file tree Collapse file tree 2 files changed +17
-4
lines changed Expand file tree Collapse file tree 2 files changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -485,9 +485,16 @@ Client explicitly sets the following headers:
485
485
Any other headers are set by a target browser and are not used by client.
486
486
Library does not provide any facilities to track a file uniqueness across requests, it's left on developer's consideration.
487
487
488
- Client recognizes the following response codes:
489
- * 200, 201 - chunk is successfully saved
490
- * 416, 500 - recoverable error, library tries to resend chunk 'chunkUploadRetry' times then fails
488
+ Response codes:
489
+ * 200 - last chunk is uploaded
490
+ * 201 - chunk is successfully saved
491
+ * 416 - range is not acceptable error, recoverable
492
+ * 500 - server error, recoverable
493
+
494
+ For recoverable errors server tries to resend chunk 'chunkUploadRetry' times then fails.
495
+
496
+ Response headers:
497
+ * X-Last-Known-Byte: int, library tries to resend chunk from the given offset. Applicable to response codes 200 and 416
491
498
492
499
All the other codes - fatal error, user's involvement is recommend.
493
500
Original file line number Diff line number Diff line change 62
62
html5 : true ,
63
63
debug : false ,
64
64
pingUrl : false ,
65
+ flashAbortTimeout : 0 ,
65
66
withCredentials : true ,
66
67
67
68
staticPath : './' ,
785
786
// Set upload status props
786
787
proxyXHR . total = _total ;
787
788
proxyXHR . loaded = 0 ;
789
+ proxyXHR . filesLeft = dataArray . length ;
788
790
789
791
// emit "beforeupload" event
790
792
options . beforeupload ( proxyXHR , options ) ;
797
799
, _fileOptions = _simpleClone ( options )
798
800
;
799
801
802
+ proxyXHR . filesLeft = dataArray . length ;
803
+
800
804
if ( _file && _file . name === api . expando ) {
801
805
_file = null ;
802
806
api . log ( '[warn] FileAPI.upload() — called without files' )
872
876
873
877
874
878
// ...
875
- proxyXHR . abort = function ( current ) { this . current = current ; xhr . abort ( ) ; } ;
879
+ proxyXHR . abort = function ( current ) { dataArray . length = 0 ; this . current = current ; xhr . abort ( ) ; } ;
876
880
877
881
// Start upload
878
882
xhr . send ( form ) ;
900
904
}
901
905
} ) ;
902
906
907
+ proxyXHR . statusText = "" ;
908
+
903
909
if ( _complete ) {
904
910
_nextFile . call ( _this ) ;
905
911
}
You can’t perform that action at this time.
0 commit comments