readfile() problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi gang,

I have a problem. I am using readfile() to send files to the browser. The
code is below. I had is working on another server before, but now my client
have moved to a new server and we have started to experience problems with
bigger files.

I have three different files that I am sending. They are 3MB, 15MB and 59MB
large. The 3MB and 15MB are working fine, but the 59MB does not work. I have
checked so that the file_exist() and also was able to retrieve filesize() of
the file, so the file is there. I have also tried to download it with the
url I know it is located at, and that works too.

Is there any limitations or settings of how large the files can be when
using readfile()? If so, are they settable?

header("Pragma: public");
header("Expires: 0"); // set expiration time
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Content-Type: application/octet-stream");
header("Content-Disposition: attachment; filename=$Row[filename]");
header("Content-Transfer-Encoding: binary");
$filesize = filesize($filelocation);
header("Content-Length: $filesize");         
readfile($filelocation);

Best regards,
Peter Lauri

www.lauri.se - personal website
www.dwsasia.com - company website

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux