I have a page where the user clicks a link to download a file, but the
file is out side of the root DIR.
passing certain variables in the link, (type, file_name) I call the
correct file...
However, it's stopped working?
My code below shows how I select the correct mime info to pass to the
header.. but I keep getting promted to download an HTML file all the
time...
if ($type == 'pdf') {$mimeinfo = "application/pdf";} else
if ($type == 'doc') {$mimeinfo = "application/msword";} else
if ($type == 'exe') {$mimeinfo = "application/octet-stream";} else
if ($type == 'ppt') {$mimeinfo = "application/vnd.ms-powerpoint";}
else
if ($type == 'xls') {$mimeinfo = "application/vnd.ms-excel";} else
if ($type == 'xml') {$mimeinfo = "text/xml";} else
if ($type == 'zip') {$mimeinfo = "application/zip";}
header("Content-Disposition: attachment; filename=$file");
header("Content-Length: " . filesize($path));
header("Content-Type: $mimeinfo");
readfile("$path");
My problem page is:
http://www.risk.sungard.com/download/?id=12617
click in the link 'Settlements >>' and you'll see what I mean, it says
it's a pdf, but when you have to specify the download location, it saves
simply the html page?
can anyone spot my probably stupid error?
Tris...
*********************************************************************
The information contained in this e-mail message is intended only for
the personal and confidential use of the recipient(s) named above.
If the reader of this message is not the intended recipient or an agent
responsible for delivering it to the intended recipient, you are hereby
notified that you have received this document in error and that any
review, dissemination, distribution, or copying of this message is
strictly prohibited. If you have received this communication in error,
please notify us immediately by e-mail, and delete the original message.
***********************************************************************