readfile() problem



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
.



Relevant Pages

  • email help
    ... currently i am doing a personal website and keep on changing the aspect... ... vb.net) and the login with security part of capturing user computer user name ... email will be sent to me whether to accept the request or not.. ... tat is fine for me as i can use the server being ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: (static) HTML generation for website using CL
    ... I would like to generate my personal website using CL. ... website, with papers and course materials, and I just want to automate ... I control the server, it is ... different depending on whether you decide when to regenerate the pages to reflect which PDFs have changed or whether the server does that automatically. ...
    (comp.lang.lisp)
  • Re: CPU Usage ?
    ... Personal website: ... >I just migrated an Exchange 2000 server to Exchange 2003 on a new server. ... > All seems to be running fine, but the CPU Usage seems to be peaking. ...
    (microsoft.public.exchange2000.admin)
  • Problem with Language monitor
    ... My project is divided into two parts one is client and other is server (which is Language Monitor DLL). ... On server side creates NamedPipe using “CreateNamedPipe” and waiting for Client connection using “ConnectNamedPipe” Win32 API’s. ... Once the connection is established ReadFile and WriteFile follows. ...
    (microsoft.public.development.device.drivers)
  • Problem with Language Monitor
    ... My project is divided into two parts one is client and other is server (which is Language Monitor DLL). ... On server side creates NamedPipe using “CreateNamedPipe” and waiting for Client connection using “ConnectNamedPipe” Win32 API’s. ... Once the connection is established ReadFile and WriteFile follows. ...
    (microsoft.public.win32.programmer.gdi)