Gossamer Forum
Home : General : Perl Programming :

File Downloads...

Quote Reply
File Downloads...
Hi guys,

I'm trying to get a script to download a file through a Perl script. I've got it working perfectly, up to the part where it actually does the download;

Code:
print qq{Accept-Ranges: bytes\n};
print qq{Content-Transfer-Encoding: 'binary'\n};
print qq{Content-Length: $file_size\n};
print qq{Content-Type: $file_mime;\n};
print qq{Content-Name: "$file_name"\n};
print qq{Content-Disposition: attachment; filename="$path"\n\n};
open(FILE,$path);
binmode(FILE);
my $line;
while (defined ($line = <FILE>)) {
print $line;
}
close(FILE);

Basically, the problem I am having... is the actual name of the document itself. Currently, whenever you try and download... it comes up as "download[1].cgi" ... and I can't for the life of me, work out how to change it to the real filename :(

Probably something really stupid, so sorry in advance <G>

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Subject Author Views Date
Thread File Downloads... Andy 9970 Feb 4, 2005, 4:04 AM
Thread Re: [Andy] File Downloads...
dan 9866 Feb 4, 2005, 8:41 AM
Thread Re: [dan] File Downloads...
Andy 9807 Feb 4, 2005, 9:08 AM
Thread Re: [Andy] File Downloads...
Gmail 9892 Feb 4, 2005, 9:17 AM
Thread Re: [Gmail] File Downloads...
Andy 9905 Feb 4, 2005, 9:28 AM
Post Re: [Andy] File Downloads...
Gmail 9814 Feb 4, 2005, 9:33 AM
Thread Re: [Andy] File Downloads...
dan 9853 Feb 4, 2005, 9:40 AM
Thread Re: [dan] File Downloads...
Andy 9756 Feb 12, 2005, 2:47 AM
Thread Re: [Andy] File Downloads...
zaaron 9768 Feb 12, 2005, 4:37 AM
Post Re: [zaaron] File Downloads...
Andy 9740 Feb 12, 2005, 7:01 AM
Post Re: [Andy] File Downloads...
Gmail 9847 Feb 4, 2005, 8:54 AM