-
Notifications
You must be signed in to change notification settings - Fork 101
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
Support streams with unknown length? #16
Comments
I am redesigning Vimeo Upload API. I am thinking of adopting tus protocol. I have couple of questions and suggestions. I will probably make a separate github issues. We have had requests from users wanting to upload unknown length not necessarily to pipe it to our transcode pipeline. I totally agree with you. It should be elegant solution and should not complicate the 99% of the use cases. Here is what I am thinking. Let me know: How about making "Content-Range" header optional POST /files HTTP/1.1 PUT /files/24e533e02ec3bc40c387f1a0e460e216 HTTP/1.1 PUT /files/24e533e02ec3bc40c387f1a0e460e216 HTTP/1.1 To indicate completion of upload. |
@vayam what's your timeline for this? Having vimeo adopt the tus protocol would be a huge honor, but I think it will take us a few more weeks to create the right solution here. I've spend a lot of time discussing the right headers and http features with various people, including the httpbis (http 2.0) working group, and I'm currently gravitating towards:
Anyway, creating a solution for your use case should be very doable, and I hope to have a new 0.2 proposal up by the end of this week. |
@felixge I like the way this is shaping. Our current Uploadservers already supports resumable uploads, parallel chunked uploads. So I can totally wait for few more weeks till your spec is finalized. I was not very thrilled with wrong usage of Range header in response and Content-Range in request. For the most basic case: Content-Type: image/jpeg; offset=-1 would mean append Parallel chunks are more of a special case. It should be optional or add on like you said. There should be way for client to detect if the server supports parallel chunks. It could be as simple as custom request header x-tus-chunk. The server can respond back as not supported with a 412 Precondition Failed Is it more useful to send out 206 for HEAD/GET requests when the file is still being uploaded. HTTP/1.1 206 Partial Content Do you plan handle pause and resume? A lot of our users like the feature. a use case is start upload at a coffee shop and pause the upload and then resume when you get home. It can be easily be handled if we keep expiry of incomplete upload for a longer duration. It is probably not needed to explicitly indicate a pause to server. I have some thoughts about supporting checksum/md5 and metadata for the file being uploaded (during upload and after). Other things are signing the requests for security. Though these should not be part of core spec. I would like to see how they can be built on top as extensions. Probably that is already being discussed. I will go through all open discussions and get back to you on those. |
I'm thinking if the server replies with a
I don't think the protocol would need anything extra to support pauze/resume. In fact the jquery plugin demo that I wrote with @tim-kos based on the initial draft of the protocol already features a stop button. Resume would be easy to implement clientside, without adding additional changes / specification to the protocol. |
Yeah. I think in order to create something that is usable today, we have to give up on the idea of making the entirely RESTful. So I'm actually thinking about using POST instead of PATCH/PUT.
I think feature detection will mean additional network / resource overhead in many cases, so IMO enabling the optional extensions should be done via configuration options in the clients, which of course will only work when uploading against servers that support it. This does require clients to know about the capabilities of the servers they target, but this is really not different from the client knowing that the server speaks the tus protocol to begin with.
As you and @kvz said, this feature is kind of implicitly supported by the protocol, and it's up to the application to decide how long to keep partial uploads for resumability. That being said, I'll add a section in the protocol FAQ about this.
Sure, there are a lot of great discussions on all of these topics, but not much in the way of working solutions yet. IMO it will make most sense to wait for the 0.2 proposal which I'll push out ASAP as this will give us a better base for discussing individual features. |
It's been over a year, where are things at on this? |
Since If the client wants to upload a file with unknown length it should leave the |
|
To correct myself using a single
Now the server knows that the files will be 300 bytes (value of Entity-Length header). It currently only has bytes 0-100 and 200-300, thou. |
See #49 for the proposed changes. |
A new round of questions :) Let's say a client started to upload an infinite stream, e.g. live video recording. What should happen when at some point server decides it cannot accept more data? Another one: Can a streaming upload be used to provide stream oriented processing or should this be beyond the scope? In other words, can server start processing the incoming data while the upload is still unfinished? This can potentially save a lot of server's disk space and spread resource utilization over time. Should implementations be allowed to do this or can you think of any problems? I think it prevents checking the control sum but implementation may not care. |
As long as the server hasn't sent any status code yet (or responded with a
It depends on the client's usage. If the resource is still available but can't be completed the client may do so.
In theory yes, but the protocols also allows offsets different then the current amount of uploaded bytes (see non-contiguous chunks and parallel uploads). So you can't rely on this currently since |
Implement in #49. |
see discussion here: http://www.tus.io/protocols/resumable-upload.html#comment-865108402
The text was updated successfully, but these errors were encountered: