On Nov 23, 2004, at 1:37 PM, Korey Fort wrote:
I know there is a way to do it using FTP. I can't remember how exactly, but I found some links that may help.
http://www.experts-exchange.com/Networking/Q_20939305.html
http://freebooks.by.ru/view/RedHatLinux6Unleashed/rhl6u074.htm <---- This is it. This is from the book I have. Been a while since I read it but here's the answer. So if you can put the file on an FTP server you can make your job a whole lot easier, I guess! :-)
Example of an /etc/ftpconversions Entry
The following is a sample entry that compresses files using gzip on demand. This would allow someone who wants to get the file orb_discography.tar to instead request the file orb_discrography.tar.gz and have the server compress the file by using gzip before sending it him. The configuration line that does this is as follows:
: : :.gz:/bin/gzip -9 -c %s:T_REG:O_COMPRESS:GZIP
----- Original Message ----- From: "Sean Davis" To: "'[EMAIL PROTECTED]' Lists" Subject: Forcing download of compressed file Date: Tue, 23 Nov 2004 08:11:08 -0500
>
> I have a simple question:
>
> I have a file that is a tar.gz file that I want download to the user
> when a form is submitted. The file is static and I know how to set
> headers, etc., for download. Is there a specific header type for
> tar.gz files (so that the browser will try to uncompress, etc.)? How
> do I need to print such a file so as to maintain the compressed format
> (do I need to set to binary, etc.)?
Korey,
Thanks for the reply. I would love to be able to put this behind an "auth" site, either ftp or http. Then, I could just serve the link. However, what I have is a CGI script that has its own authentication and user maintenance, so I have to rely on it for authentication. Therefore, I can't just serve up the file link (because people could grab that link and download at will), but have to have the download be generated by the CGI if it is to remain (reasonably) secure. The file is already gzipped, so I don't need to do it on the fly. I am just interested in how to print the gzipped file to the page and what is the most appropriate header to use to signal to the browser that the file is a tar.gzip file. Any more insight?
Thanks, Sean
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>