titanic_fanataic has asked for the wisdom of the Perl Monks concerning the following question:
I'm trying to force the download of an adobe pdf file, and I don't want to reaname the ext to zip or anything like that. What I want is a link that leads to my download counter to count the download, then force the pdf file to download. I've got the file to force download, but when I try to open the file that I downloaded, adobe tells me that the file has been corrupted.
The code that I used was that from this node "Need help with downloading".
The only thing that I changed from this code was removed the
File::Type(I don't have access to this on my server)
and changed
print 'Content-Type: ', File::Type->new()->mime_type($filePath[$i]) || 'application/force-download', "\n";
to
print 'Content-Type: ', 'application/pdf' || 'application/force-download', "\n";
I'm able to download the file, but it doesn't download correctly. Can someone please tell me why, and how to go about doing this properly.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Download PDF
by ruoso (Curate) on Jun 18, 2005 at 12:56 UTC | |
by BaldPenguin (Friar) on Jun 18, 2005 at 15:57 UTC | |
by titanic_fanataic (Acolyte) on Jun 19, 2005 at 01:30 UTC | |
by BaldPenguin (Friar) on Jun 19, 2005 at 07:14 UTC | |
|
Re: Download PDF
by PodMaster (Abbot) on Jun 18, 2005 at 08:45 UTC | |
|
Re: Download PDF
by davidrw (Prior) on Jun 18, 2005 at 13:33 UTC |