You are here: Re: Looking for a script to download pdf file from server « PHP Programming Language « IT news, forums, messages
Re: Looking for a script to download pdf file from server

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация