diff --git a/docs/docs/en.md b/docs/docs/en.md index 6aa5f34..ee2175c 100644 --- a/docs/docs/en.md +++ b/docs/docs/en.md @@ -149,7 +149,7 @@ The backend should provide a `session_id` (to identify the upload) and a `end_of In this phase we'll upload every chunk until all of them are uploaded. This step allows some failures in the backend, and will retry up to `maxRetries` times. -We'll send the `session_id`, `start_chunk` and `chunk` (the sliced blob - part of file we are uploading). We expect the backend to return `{ status: 'success' }`, we'll retry otherwise. +We'll send the `session_id`, `start_offset` and `chunk` (the sliced blob - part of file we are uploading). We expect the backend to return `{ status: 'success' }`, we'll retry otherwise. Use the option `uploadBody` to add more parameters to the body of this request. diff --git a/src/chunk/ChunkUploadHandler.js b/src/chunk/ChunkUploadHandler.js index 24ede0b..97f21de 100644 --- a/src/chunk/ChunkUploadHandler.js +++ b/src/chunk/ChunkUploadHandler.js @@ -44,6 +44,13 @@ export default class ChunkUploadHandler { return this.file.size } + /** + * Gets the file size + */ + get fileName () { + return this.file.name + } + /** * Gets action (url) to upload the file */ @@ -222,7 +229,8 @@ export default class ChunkUploadHandler { body: Object.assign(this.startBody, { phase: 'start', mime_type: this.fileType, - size: this.fileSize + size: this.fileSize, + name: this.fileName }) }).then(res => { if (res.status !== 'success') {