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

Last chunk can be twice as big as the chunk size #44

Open
nerg4l opened this issue Jun 12, 2020 · 0 comments
Open

Last chunk can be twice as big as the chunk size #44

nerg4l opened this issue Jun 12, 2020 · 0 comments
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed
Milestone

Comments

@nerg4l
Copy link
Member

nerg4l commented Jun 12, 2020

When using Resumable.js, Flow.js, or simple-upload.js the last chunk can be bigger than the chunkSize parameter. Max twice as big but it is not defined in any of the mentioned libraries' documentation.

At the moment OneBasedRequestBodyRange component has the following check:

https://github.com/LaraCrafts/laravel-chunk-uploader/blob/029d3253c0fa3c11e313b338efaf033d80bdb14f/src/Range/OneBasedRequestBodyRange.php#L47

This makes it invalid without setting forceChunkSize.

A configuration should be introduced for forceChunkSize and the mentioned validation should compare totalSize with (numberOfChunks + 1) * chunkSize.

For now I will add a note in the README to use forceChunkSize option when using the above mentioned libraries.

@nerg4l nerg4l added bug Something isn't working help wanted Extra attention is needed good first issue Good for newcomers labels Jun 12, 2020
@nerg4l nerg4l added this to the Unplanned milestone Jun 12, 2020
@nerg4l nerg4l modified the milestones: Unplanned, v1.0.0 Apr 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant