tags:

views:

24

answers:

2

I have a perl script which accepts incoming POST and PUT requests from other command line clients, gets the data (gzip) associated with each request and writes out to a seperate file.

I want to extend the script by adding redirect functionality.

Here is what I'm planning to do * Once the data file is written, forward/redirect the file with the same headers(which we received from clients ) to another URL using LWP.

Please let me know about how to do that.

A: 

LWP is a Web client library; I think you want CGI's redirect method or similar.

daxim
Hi daxim,I guess LWP can also be used from the command line.. any ideas how to use the CGI's redirect with gzip attachment and additional headers.
See [creating a standard HTTP header](http://p3rl.org/CGI#CREATING_A_STANDARD_HTTP_HEADER:) and [`Content-Disposition: attachment`](http://en.wikipedia.org/wiki/MIME#Content-Disposition). I don't think this attachment business to force a download is of much use, just deliver the file as-is with the appropriate `Content-Type` header.
daxim
A: 

Thank you for your suggestions