You are here: Re: upload big file « PHP Programming Language « IT news, forums, messages
Re: upload big file

Posted by Chung Leong on 10/13/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.

 

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

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