Hi Connie, Here is a script I made and it starts the file download. It prompts for a file name and the default one is the file name you give in the script. Sometimes it works only if the file name you define in the script is the same with the real file name of the file.
$| = 1; my $file = "$docroot/$outfolder/$id"; #If the file exists: if (-e $file) { print <<eof; Content-type: application/zip Content-Disposition: attachment; filename=$id eof open (FH, $file); binmode(FH); binmode(STDOUT); until (eof FH) { read (FH, my $buf, 1024); print $buf; } close FH; Teddy's Center: http://teddy.fcc.ro/ Mail: [EMAIL PROTECTED] ----- Original Message ----- From: "Connie Chan" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Monday, August 12, 2002 2:46 AM Subject: How to give a name for a file? > I have a script that read and then print a binary file on runtime, > which actually mean to a file is for download. > > I mean, not like this : <a href="here_a_file.zip">Download</a>. > > However, I don't know how to give a name for the file. > > I've use this header : print "Content-type: audio/mp3\r\n\r\n"; > and my script 's name is dl.pl. > > When I start to download the file, my browser alert if I want to > save "dl.mp3" . Why the extension can come out, but nowhere for me > to assign the file name ? > > Could any body tell me what is the story ? > and how to give a certain name for the file ? > > Rgds, > Connie > > > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]