didede
asked on
Change default filename when downloading from cgi
Hi,
I am using a cgi script (perl with windows nt) to send file to client browser (download fonction).
The problem is : when the window open (save as), the default name of the file is the name of the cgi program.
how can i change the default name before the "save as" window open ??
I use this code to send the file :
print "HTTP/1.0 302 Found\n";
print "Content-type: multipart/x-zip\n\n";
binmode STDOUT;
open (FILE, $file);
binmode(FILE);
read (FILE, $buffer, -s $file);
print $buffer;
close(FILE);
thanks
I am using a cgi script (perl with windows nt) to send file to client browser (download fonction).
The problem is : when the window open (save as), the default name of the file is the name of the cgi program.
how can i change the default name before the "save as" window open ??
I use this code to send the file :
print "HTTP/1.0 302 Found\n";
print "Content-type: multipart/x-zip\n\n";
binmode STDOUT;
open (FILE, $file);
binmode(FILE);
read (FILE, $buffer, -s $file);
print $buffer;
close(FILE);
thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Content-disposition: inline; filename="myfile.zip"
and you might want to use this too:
Content-type: multipart/x-zip; name="myfile.zip"
Michel