CGI, Zip and Downloading

Greg Walters pwdrhound at pcisys.net
Thu Jun 5 21:54:15 CDT 2003


On Wednesday, June 4, 2003, at 02:08 PM, John Evans wrote:

> 2) Create the file on the fly and toss a the file with a Content-type 
> that
> forces all browsers (with default configs) to download the file 
> instead of
> display it.
> 	Problems with this solution:
> 	a) I haven't a clue on which Content-type may do this.
> 	b) The default filename is always the name of the script. Again,
> telling the users to rename the file "contacts.txt" is beyond their
> abilities.

John,

I too would go with #2. When I was at the School District, I wrote a 
Perl script that returned a random image from a set of 15. The script 
was called "random.gif" and worked as long as I returned the actual GIF 
image as output. I can't remember how I got Apache to actually execute 
the script rather than trying to return its contents as the image. 
However, I don't think it was too difficult. If I can find the CD I 
burned when I left, I'll get you that information.

Good luck.

Greg




More information about the Pikes-peak-pm mailing list