|
RasterWeb: Code: Perl > sendfile.cgiThis is a simple perl cgi script that sends a file to a web browser as an attachment. I'm not sure where I got this from, but I like to have it handy, so here it is... And if you've got a better way to do it, let me know! #!/usr/bin/perl # open (FILE, "path/to/yourfile.gz"); local ($/); $file = <FILE>; close (FILE); print "Content-type: application/x-gzip\n"; print "Content-Disposition: attachment; filename=yourfile.gz\n"; print "Content-Description: File to download\n\n"; print $file; # END |
|||||||||||||||
|
Last Modified: 08.17.2000 by rasterboy |
||