Handling incoming HTTP PUT - RESUME (partial content) in cgi

Handling incoming HTTP PUT - RESUME (partial content) in cgi

am 23.08.2010 11:19:57 von llama

At present I have a Perl cgi script accepts incoming HTTP POST
requests from various clients. The cgi checks the headers for "POST"
request and then reads in the data and writes out the data in a file
(this file is created as yyyymmddhhmmss.processid) at a specified
location.

Now, I had to extend the cgi to also support HTTP PUT RESUME (partial
content) functionality.
What this means is, the clients sending the data to the cgi will stop/
terminate
the connection after a specified number of bytes. The client can
resume the partial PUT request at a later point of time, the clients
will do so until the complete data/attachment is transferred.

I'm looking for suggestions on implementing the "partial
content" (a.k.a HTTP PUT RESUME ) functionality into the cgi.

Here are some of the points i've been trying to address:

* How and where do I store the partial PUT request data
* How to uniquely identify the resumed requests from the clients and
completely
process the request from a given client.
* Can any of the Apache module or mod_perl help me in solving the
issues.
* What settings changes need to be done in Apache.

Does anyone has sample code or suggestions about how to go about the
above.

Below are the headers that I'll be receiving from the client

PUT /pups_00034326714e2364_21.7z HTTP/1.1
Cache-Control: no-store
Connection: close
Expect: 100-continue
Host: test033S2121
User-Agent: curl/7.7.3 (i686-pc-linux-gnu) libcurl 7.7.3 (OpenSSL 0.9.
+6)
Content-Length: 190626
Content-Range: bytes1024-*/*
Content-Type: application/x-7z-compressed


--
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
http://learn.perl.org/