
wilsonr
Deleted
Jun 27, 2000, 11:53 AM
Post #1 of 2
(1090 views)
|
Sending file from CGI Perl script ... again
|
Can't Post
|
|
Hi all, I have a Perl CGI script using the following code (thanks to Kanji) that sends a file to the users browser ... ----------------- code --------------------- if ( open FILE, "/path/to/some.gif" ) { print "Content-Type: application/octet-stream\n\n", <FILE>; close FILE;} else { print "Content-Type: text/plain\n\n", "Couldn't open some.gif because: $!\n";} -------------------------------------------- ...however, when the user is prompted to download the file, the name of the file always defaults to the name of the Perl script sending the file. Is there any way around this so that the name of the file is always the name of the file being downloaded? Best regards Rod Wilson
|