@@ -18,6 +18,7 @@ import {
18
18
RxFileUploadAdditionalFormData ,
19
19
RxFileUploadBodyData ,
20
20
RxFileUploadChunkBodyData ,
21
+ RxFileUploadChunkData ,
21
22
RxFileUploadChunkFormData ,
22
23
RxFileUploadChunkSequenceData ,
23
24
RxFileUploadChunkSize ,
@@ -126,6 +127,13 @@ export class RxFileUploadCls implements RxFileUpload {
126
127
* @internal
127
128
*/
128
129
private readonly _useChunks : boolean = false ;
130
+ /**
131
+ * Property to store default mime type for a chunk
132
+ *
133
+ * @private
134
+ * @internal
135
+ */
136
+ private readonly _chunkMimeType : string = 'application/octet-stream' ;
129
137
/**
130
138
* Property to store flag to know if progress Observable will complete at the end of the upload process
131
139
*
@@ -691,15 +699,22 @@ export class RxFileUploadCls implements RxFileUpload {
691
699
data : {
692
700
...fileData ,
693
701
chunkData : this . _serialize ( {
702
+ name : `${ file . name } .part${ index + 1 } ` ,
703
+ size : _ . endByte - _ . startByte ,
704
+ lastModified : file . lastModified ,
705
+ type : this . _chunkMimeType ,
694
706
sequence : index + 1 ,
695
707
totalChunks : chunkSizes . length ,
696
708
startByte : _ . startByte ,
697
709
endByte : _ . endByte ,
698
- } ) ,
710
+ } as RxFileUploadChunkData ) ,
699
711
file : new File (
700
712
[ file . slice ( _ . startByte , _ . endByte ) ] ,
701
- file . name ,
702
- { type : file . type } ,
713
+ `${ file . name } .part${ index + 1 } ` ,
714
+ {
715
+ type : this . _chunkMimeType ,
716
+ lastModified : file . lastModified ,
717
+ } ,
703
718
) ,
704
719
} ,
705
720
formData : new FormData ( ) ,
0 commit comments