Posted by Dynamo on 11/30/76 11:48
Many thanks but somehow I dont think that snippet of code on its own will do
what I want. I was looking for the complete code. I have tried the following but
it failed miserably. What am I doing wrong?
<?php
$dir_name = "/books/";
$file = "downloadtest.pdf";
$content = file_get_contents($dir_name . $file);
header('Content-Type: pdf');
header('Content-Length: ' . filesize($dir_name . $file));
header('Content-Disposition: 'attachment');
echo $content;
?>
Regards
Dynamo
In article <e4v2b9$phg$1@netlx020.civ.utwente.nl>, Rik says...
>
>Dynamo wrote:
>> Hi,
>>
>> I am looking for a script that will download a pdf file from my
>> server without opening it in IE. I want peeople to be able to simply
>> download the file and store it in a location on their PC. Any help
>> greatly appreciated.
>
>header('Content-disposition: attachment');
>
>Grtz,
Navigation:
[Reply to this message]
|