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

How to clear the chunk cache or solve this problem? #94

Open
cryinrain69 opened this issue Jul 18, 2023 · 1 comment
Open

How to clear the chunk cache or solve this problem? #94

cryinrain69 opened this issue Jul 18, 2023 · 1 comment
Labels

Comments

@cryinrain69
Copy link

If I select a new file to upload, everything works fine.
But then I select that file again (I've uploaded it before) and it fails to upload, crashes when calling uploader.finish()
Logs:

io.tus.java.client.ProtocolException: unexpected status code (400 or 500) while uploading chunk
17:55:09.578 System.err en....atech.vovnews W at io.tus.java.client.TusUploader.finishConnection(TusUploader.java:343)
17:55:09.579 System.err en....atech.vovnews W at io.tus.java.client.TusUploader.finish(TusUploader.java:321)
17:55:09.579 System.err en....atech.vovnews W at io.tus.java.client.TusUploader.finish(TusUploader.java:306)

I checked and found uploader.uploadChunk() = -1, before do do { ...} while(uploader.uploadChunk() > -1)

I thought clearing chunk cache might be a solution but I couldn't find that method.

@Acconut
Copy link
Member

Acconut commented Jul 19, 2023

I thought clearing chunk cache might be a solution but I couldn't find that method.

There is no direct method for doing this, but you can try to clear the SharedPreferences that are passed to TusPreferencesURLStore:

public TusPreferencesURLStore(SharedPreferences preferences) {

But then I select that file again (I've uploaded it before) and it fails to upload, crashes when calling uploader.finish()

Please provide all answers to the question template and provide your uploading code: https://github.com/tus/tus-android-client/blob/main/.github/ISSUE_TEMPLATE/question.md Otherwise, it is hard for us to help you.

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