diff --git a/README.md b/README.md index 70bd6b71..02ccd184 100644 --- a/README.md +++ b/README.md @@ -415,8 +415,8 @@ On your server you need to keep track of what files are being uploaded and how m set that back to zero to allow re-uploading the same file. * Optionally you can specify `resumeChunkSize` to upload the file in chunks to the server. This will allow uploading to GAE or other servers that have file size limitation and trying to upload the whole request before passing it for internal processing.
- If this option is set the requests will have three extra fields: - `_chunckSize`, `_chunkNumber` (zero starting), and `_totalSize` to help the server to write the uploaded chunk to + If this option is set the requests will have the following extra fields: + `_chunkSize`, `_currentChunkSize`, `_chunkNumber` (zero starting), and `_totalSize` to help the server to write the uploaded chunk to the correct position. Uploading in chunks could slow down the overall upload time specially if the chunk size is too small. diff --git a/src/upload.js b/src/upload.js index d21bf184..9f1a1a5c 100644 --- a/src/upload.js +++ b/src/upload.js @@ -219,7 +219,8 @@ ngFileUpload.service('UploadBase', ['$http', '$q', '$timeout', function ($http, slice.name = file.name; slice.ngfName = file.ngfName; if (config._chunkSize) { - formData.append('_chunkSize', config._end - config._start); + formData.append('_chunkSize', config._chunkSize); + formData.append('_currentChunkSize', config._end - config._start); formData.append('_chunkNumber', Math.floor(config._start / config._chunkSize)); formData.append('_totalSize', config._file.size); }