kfying2005-05-09 16:14:32
Can anyone let me know why my download script won't work?
After a user clicks a download link, this script will run, but it does not work:

#!/usr/bin/perl -w

use CGI qw(:standard);

my $q=new CGI;

print $q->header(-type => "text",
-attachment => "/var/www/cgi-bin/jack/project/ex.txt");

It does popup a download window, but does not give the filename and
type, and the file it downloads is always 0 byte.

also tried this, the download window does show file type, but still
the file downloaded is 0 byte

#!/usr/bin/perl -w

use CGI qw(:standard);

my $q=new CGI;

print $q-header(-type => "application/vnd.ms-excel",
-attachment =>
"/var/www/cgi-bin/jake/project/ex.xls");