tus / tusd

Reference server implementation in Go of tus: the open protocol for resumable file uploads
https://tus.github.io/tusd
MIT License
2.95k stars 467 forks source link

Close unfinished file #1017

Closed mskayali closed 7 months ago

mskayali commented 9 months ago

Hi, Im working on a device and I get binary data by a stream and I wouldn't know the total stream size, I just able to understand while stream is done.

Is it possible to add a protocol feature to close specific unfinished files by a request? That would be better if I able to give first post request header as "uploadLengthHeader" : "infinit" to finish file by a featured request.

mskayali commented 9 months ago

I solved this, please take a look if you still read this https://github.com/tus/tusd/pull/1018

Acconut commented 8 months ago

The tus protocol already supports this using the Upload-Defer-Length header. It works basically as you implemented it: The initial POST request includes Upload-Defer-Length: 1 to indicate the absence of a finite length and a future PATCH request can then send the actual length via Upload-Length. tusd also implements this extension by default.