Skip to content

File ending with hyphens #411

Open
Open
@sergioaschar

Description

@sergioaschar

I'm not sure if this is a problem with the component, but I've had errors with files ending with hyphens (-------).

After some tests, I found the reason: the form-data boundary uses hyphens to delimit the data, so the last characters of the file are confusing the stream reader.

A possible solution I found to work around was to use the uploadBody object in the options to force the order of the fields, like this:

uploadBody: { chunk: null }

However, I think it's a good idea to change the order of the form fields:

    sendFormRequest(chunk.xhr, Object.assign(this.uploadBody, {
      chunk: chunk.blob,
      phase: 'upload',
      session_id: this.sessionId,
      start_offset: chunk.startOffset,
    })).then(res => {
      ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions