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

Unable to resume uploads, Upload-Offset is always 0 #121

Closed
vldgeorgiev opened this issue Jan 26, 2019 · 1 comment
Closed

Unable to resume uploads, Upload-Offset is always 0 #121

vldgeorgiev opened this issue Jan 26, 2019 · 1 comment

Comments

@vldgeorgiev
Copy link

vldgeorgiev commented Jan 26, 2019

Hi
There is one problem I am having while making a pascal client for tus.
I can successfully issue a POST to create a resource. It returns the resource location URL, which I checked and it returns a header "Upload-Offset:0". This is expected, because no data has been uploaded yet.

After that I send a PATCH and it starts uploading. If I interrupt the connection before it is finished, the HEAD call for the resource still returns "Upload-Offset:0", so no data has been saved and the upload can't be resumed. If I understand the protocol correctly, the offset should indicate the number of bytes that were transferred before the interruption.
If the connection is not interrupted, the upload finished properly and the Upload-Offset indicates the size of the upload.

I made several tests: with my client and with the Postman app, on the https://master.tus.io server and on a server running the official node.js implementation. All the results were the same.

The only conclusion that comes to mind is that I am not using chunked transfer mode. Is that a requirement for resuming?

Here is the Postman PATCH request, for reference

PATCH /uploads/e8395bfb60b88618e50b1948eed5149e HTTP/1.1
Host: XYZ
Tus-Resumable: 1.0.0
Content-Type: application/offset+octet-stream
Upload-Offset: 0
Content-Length: 10000000
Cache-Control: no-cache

The tus protocol is built upon the principles of simple pausing and resuming. In order to pause an upload you are allowed to end the current open request. The Server will store the uploaded data as long as no violations against other constraints (e.g. checksums) or internal errors occur.

There are no checksums sent and I don't think a simple disconnect would cause internal server errors.

Thanks for any advice on the topic.

@vldgeorgiev
Copy link
Author

Posted in the wrong repo. Should have been in us-resumable-upload-protocol

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