Andre_br has asked for the wisdom of the Perl Monks concerning the following question:
I´m stuck in a task I won´t acomplish without thy help.
Its so simple and tricky that irritates! I just want the client´s browser not to go on loading a .xls file. Instead, I want him to show the upload dialog and ask for the file name, the directory etc...
Here´s my code:
my xlsfile = "table.xls";
open(DLFILE, "../uploads/$xlsfile") || die "Error";
@fileholder = <DLFILE>;
close (DLFILE);
print "Content-Type: application/x-download\n";
print "Content-Disposition: attachment; filename=../uploads/$xlsfile\n\n";
print @fileholder;
The result of the code above is that he does show the dialog box, but he displays instead of the name of the file, the name of my CGI script. And also, and worse, the file it saves is almost empty and misformatted.
Any ideas?
Thanks a lot, guys!
André
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Force Download to a .xls file
by jmcnamara (Monsignor) on Jan 04, 2005 at 01:33 UTC | |
by Andre_br (Pilgrim) on Jan 04, 2005 at 05:04 UTC | |
by holli (Abbot) on Jan 04, 2005 at 08:30 UTC | |
by holli (Abbot) on Jan 04, 2005 at 09:11 UTC | |
Re: Force Download to a .xls file
by Errto (Vicar) on Jan 04, 2005 at 01:45 UTC | |
Re: Force Download to a .xls file
by edan (Curate) on Jan 04, 2005 at 12:15 UTC | |
by existem (Sexton) on Feb 16, 2005 at 12:39 UTC |