Closed FuGangqiang closed 9 years ago
Since a POST
request to an existing upload URL is not defined in tus, it's theoretically not forbidden but we discourage such behaviour. Currently, there is no mechanism for updating metadata but the length can be deferred as described in https://github.com/tus/tus-resumable-upload-protocol/blob/046960aa214564a11d118f3c39b426aef673f7c1/protocol.md#post (but only once, you cannot change it twice).
Maybe I didn't describe the question of the upload-length clearly, and again:
Is Upload-Length
only set by PATCH when Upload-Defer-Length
?
can it be set in a POST request when Upload-Defer-Length
?
Thanks for clarifying your question. As I said a POST
request against an upload URL is not defined by the specification and therefore not valid according to protocol (although it's not strictly forbidden).
So the answers are:
Is Upload-Length only set by PATCH when Upload-Defer-Length?
Yes.
can it be set in a POST request when Upload-Defer-Length?
No.
Could the origin of your question be that your platform/programming language does not support the PATCH
method? If so, we support the X-HTTP-Method-Override
header which allows you to use POST
instead.
I got it! Thanks for your patience in answering all my questions!
After POST a upload url, I will get the location for upload, after a few PATCHs, is it valid to POST the location url?
In the second POST, is it valid to update metadata and upload-length(if defer upload length)?