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

If file Size equals to payload size, the upload fails. #69

Closed
bestMechanic opened this issue Jun 1, 2022 · 3 comments
Closed

If file Size equals to payload size, the upload fails. #69

bestMechanic opened this issue Jun 1, 2022 · 3 comments
Assignees
Labels

Comments

@bestMechanic
Copy link

If you upload a file of size equal to payload size, the upload fails.
Because it tries to make 1 extra attempt to upload the last chunk with 0 file length.

This seems a very generic issue, it shouldn't make a new attempt to upload the last chunk of size 0 byte.
while (uploader.uploadChunk() > 0)

@Acconut
Copy link
Member

Acconut commented Oct 18, 2022

Thank you for reporting this, we will investigate. However, it seems to be more related to tus-java-client than tus-android-client.

@Acconut Acconut self-assigned this Oct 18, 2022
@Acconut Acconut transferred this issue from tus/tus-android-client Oct 18, 2022
@Acconut
Copy link
Member

Acconut commented Jan 17, 2023

I am not able to reproduce an upload failure, even when adding uploader.setRequestPayloadSize((int) file.length()); to the example in https://github.com/tus/tus-java-client/blob/master/example/src/main/java/io/tus/java/example/Main.java. You are correct that tus-java-client sends an empty PATCH request in the end. Your tus server should support such empty requests however.

We plan to improve this in the next major version of tus-java-client where we will get rid of this upload loop at together. Thanks for letting us know.

@Acconut Acconut closed this as completed Jan 17, 2023
@Acconut
Copy link
Member

Acconut commented Jan 17, 2023

See #78

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants