Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File ending with hyphens #411

Open
sergioaschar opened this issue Oct 26, 2021 · 0 comments
Open

File ending with hyphens #411

sergioaschar opened this issue Oct 26, 2021 · 0 comments

Comments

@sergioaschar
Copy link

sergioaschar commented Oct 26, 2021

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 => {
      ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant