Adding Support For Chunk File Upload
Changes to implement chunk file upload, more information on the README
This commit is contained in:
19
README.md
19
README.md
@@ -67,6 +67,11 @@ Easy to use Angular2 directives for files upload ([demo](http://valor-software.g
|
||||
5. `formatDataFunction` - Function to modify the request body. 'DisableMultipart' must be 'true' for this function to be called.
|
||||
6. `formatDataFunctionIsAsync` - Informs if the function sent in 'formatDataFunction' is asynchronous. Defaults to false.
|
||||
7. `parametersBeforeFiles` - States if additional parameters should be appended before or after the file. Defaults to false.
|
||||
8. `chunkSize` - The Size of each chunk in Bytes, if this parameter is set the file chunk upload functionality will run. Defaults to Null.
|
||||
9. `currentChunkParam` - Parameter Sent with the chunk request, the current chunk number of the file. Defaults to 'current_chunk'.
|
||||
10. `totalChunkParam` - Parameter Sent with the chunk request, the total number of chunks of the file. Defaults to 'total_chunks'.
|
||||
11. `chunkMethod` - After the first chunk, this method is set. Defaults to 'PUT' because is the standard for update.
|
||||
|
||||
|
||||
### Events
|
||||
|
||||
@@ -84,6 +89,20 @@ Please follow this guidelines when reporting bugs and feature requests:
|
||||
|
||||
Thanks for understanding!
|
||||
|
||||
### Using/Sending Chunk Files Feature
|
||||
|
||||
If you want to send the files chunked you can just set the chunk paramets on the uploader object
|
||||
|
||||
If your chunk request changes the link after the first request you should use this code
|
||||
```
|
||||
this.uploader.onCompleteChunk = (item,response,status,headers)=>{
|
||||
response = JSON.parse(response);
|
||||
if(response['id']){
|
||||
item.url = YOUR_NEW_URL+response['id']+'/';
|
||||
}
|
||||
}
|
||||
```txt
|
||||
|
||||
### License
|
||||
|
||||
The MIT License (see the [LICENSE](https://github.com/valor-software/ng2-file-upload/blob/master/LICENSE) file for the full text)
|
||||
|
||||
Reference in New Issue
Block a user