[an error occurred while processing this directive]
[url] rasterweb.net/raster/
[email] pete@rasterweb.net
[pgp key] public key

RasterWeb [More Info]
Home
About
Contact
Archives
Search
Mobile Edition
Kids
Misc
Rambles
Computers
Code

Code:
Code contains bits of text that are probably more interesting to computers than people...


[RasterWeb]

This 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



[top of page]

  Last Modified: 08.17.2000 by rasterboy