|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2002-10-13 09:08 UTC] spic@php.net
Environment: Windows WebServer: Microweb (CD-WebServer) PHP-Version: Latest CVS and 4.2.4-dev PHP is installed as CGI In a frameset-environment, PHP hangs while outputting large PDF-Files. The Frameset consists of three Frames. Every Frame is PHP-generated. One functions as "PDF-Passthrough". All works fine, if the Passthrough-File is smaller than approx. 100k. Files >100k make the system hang. Calling the passthrough-script directly (w/o frameset) causes no problems. There is no difference between using readfile, fpassthru, or fread. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 21:00:01 2025 UTC |
The following snippets illustrate the environment [frameset.php] ->frame1.php ->frame2.php ->frame3.php [frame1.php] <? header("Content-type: application/pdf\n"); readfile("some_100k_large.pdf"); ?> [frame2.php] <? echo "Something"; ?> [frame3.php] <? echo "else"; ?>In addition [frame1.php] <? // Adding sleep(5) will solve the problem the first time a // >100k File is called. The next output of a >100k File // will crash again... sleep(5); header("Content-type: application/pdf\n"); readfile("some_100k_large.pdf"); ?>I have a simmilar problem on windows 2000 Server with IIS4. I use this script (just a part): header("Content-type: Download"); header("Content-Disposition: attachment; filename=".$Data->SWFileName); $fp = fopen ($GLOBALS['FileLocation'].$Data->SWFileName, "rb"); fpassthru($fp); The problem is that on our development machine (Linux) everything works like a charm, but on our "Production" server with Win2k Server & IIS not. There is a small JavaScript which calls the file sending script usimg window.location='getfile.php?fileid=56' The problem place is that the time between request and displaying the "save" dialog is very large. (1-2 minutes or so) I can't get it to execute faster. I will try to use the fread(). Later SelfManI'm experiencing something similar on Linux Apache using Version 4.1.2. As far as I know it worked before I upgraded from an earlier version. My code looks like this: $file="/path/to/file"; $fp = fopen($file, "r"); $size=filesize($file); $contents = fread($fp, $size); fclose($fp); Header("Content-Type: $type"); Header("Content-Disposition: attachment; filename=$downloadname"); header("Content-Length: $size"); header("Content-Transfer-Encoding: binary"); echo $contents; filesize() is reporting the size properly. The code works perfectly for smaller files, but the fread() fails for files larger than 19 MB or so and I got a page cannot be displayed error. All the files being downloaded are PDF files.