Merge remote-tracking branch 'origin/master' into dev

master
d 8 years ago
commit c507c32135

@ -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. 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. Use the option `uploadBody` to add more parameters to the body of this request.

@ -44,6 +44,13 @@ export default class ChunkUploadHandler {
return this.file.size return this.file.size
} }
/**
* Gets the file size
*/
get fileName () {
return this.file.name
}
/** /**
* Gets action (url) to upload the file * Gets action (url) to upload the file
*/ */
@ -222,7 +229,8 @@ export default class ChunkUploadHandler {
body: Object.assign(this.startBody, { body: Object.assign(this.startBody, {
phase: 'start', phase: 'start',
mime_type: this.fileType, mime_type: this.fileType,
size: this.fileSize size: this.fileSize,
name: this.fileName
}) })
}).then(res => { }).then(res => {
if (res.status !== 'success') { if (res.status !== 'success') {

Loading…
Cancel
Save