Standard method for HTTP partial upload, resume upload

I think there is no standard for partial uploads:

  • Content-Range inside requests is not explicitly forbidden in RFC2616 (http), but also the wording refers to it as an response header which gets used in response of a range-request
  • while you could use the PATCH method to update an existing resource (e.g. to add more bytes) it would not be the same as a partial upload, because all the time the incomplete resource would be available

If you look at the protocols of Dropbox, google drive etc they all roll their own protocol to transfer a single files in multiple chunks. What you need for resumeable uploads is

  • a way to address an incomplete upload. Normal URLs address a complete, not a partial resource and I know of no standard for partial resources.
  • a way to find out the current state of the upload, maybe also checksums of the part to be sure, that the local file did not change. This could be provided by WebDAV PROPFIND method (once you are able to address the incomplete resource 🙂
  • a way to upload a chunk. Here one could maybe use PATCH with a content-range header. mod_dav seems to allow PUT with content-range header (see http://www.gossamer-threads.com/lists/apache/users/432346)
  • a way to publish the resource once it is complete, or a way to define upfront what complete means (e.g size of resource, checksum…)

Leave a Comment