Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/docs/en.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
10 changes: 9 additions & 1 deletion src/chunk/ChunkUploadHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down Expand Up @@ -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') {
Expand Down