Posted by Chung Leong on 10/11/56 11:36
wakun@wakun.com wrote:
> Now, I figure out the problem by setting the post_max_size=40M in
> php.ini but I get another problem about offering a big file to
> download. I have the download script as follow
>
> $len = filesize($absfile);
> $fd = fopen($absfile, "rb");
> $contents = fread($fd, $len);
> fclose($fd);
>
> $t = "application/pdf";
>
>
> header("Content-Type: $t");
> header("Content-Length: $len");
> header("Content-Disposition: inline; filename=$filename");
> header("Pragma: private"); // fix for IE
>
> echo $contents;
>
> I found it takes almost one minute to download the file bigger than
> 20M?
It's not a good idea to serve large PDF files through PHP. The Acrobat
Reader uses partial retrieval to allow a user to quickly jump to
different parts of a document. Unless you implement partial retrieval
yourself, or use the PEAR HTTP class, this functionality is disabled
and the user would have to wait for the whole document to finish
downloading.
[Back to original message]
|