tags:

views:

100

answers:

2

Is it possible to resume interrupted uploads using HTTP Post? I am working on a project that uploads several files to a HTTP server. Thanks.

+1  A: 

HTTP works this way: you send ALL information and server process it;

So you can't resume a cancelled upload. But you can send several small file pieces and rebuild them server side

Rubens Farias
+1  A: 

Assuming you have control at a low enough level on both client and server sides of this project you could achieve this via Content-Range headers in your POST (or PUT) requests that send the data.

imaginaryboy
Except that RFC 2616 does not define how to send partial content in a client request, only in a server response. If the client request had to pass through an HTTP proxy, for instance, the uploaded data may no work correctly if partially uploaded. Better to use FTP instead of HTTP for partial file transfers.
Remy Lebeau - TeamB
Section 9.6 (PUT) of the RFC contains this sentence: "The recipient of the entity MUST NOT ignore any Content-* (e.g. Content-Range) headers that it does not understand or implement and MUST return a 501 (Not Implemented) response in such cases."To me that implies that a proxy would need to pass that header through, no? At any rate, the thought had occurred to be because mod_dav supports ranges in PUTs for exactly this purpose.
imaginaryboy
Thanks for the reply! I am uploading files by multipart/form-data now, can I use Content-Range header with it? I also found something called multipart/byteranges, is it something I should use for resuming uploads?
noear