php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #16000 fpassthru and timeouts
Submitted: 2002-03-11 11:28 UTC Modified: 2004-07-26 16:30 UTC
Votes:2
Avg. Score:4.0 ± 1.0
Reproduced:2 of 2 (100.0%)
Same Version:0 (0.0%)
Same OS:2 (100.0%)
From: lance_laureys at 3com dot com Assigned:
Status: Closed Package: Documentation problem
PHP Version: 4.1.2 OS: 2000 Server
Private report: No CVE-ID: None
 [2002-03-11 11:28 UTC] lance_laureys at 3com dot com
There seems to be a timeout problems with using fpassthru.

Code : 

header( "Content-type: application/octet-stream" );
header( "Content-Length: $c_ByteSize" );
header( "Content-Disposition: attachment; filename=\"$F\"" );
$fp = fopen("D:\\CarrierFTP_Files\\".odbc_result($result, "FilePath").$F,"r") or 	die("Can't find file.");
fpassthru($fp);

When the person starts getting the file, after 5 min 2 sec it quits and tells me it has finished. 

I have increased timeouts everywhere, but it never gets the file. Suggestions on this?

Patches

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-05-03 23:33 UTC] yohgaki@php.net
Some browsers have hard coded timeout.
Try different browsers see if it helps.
 [2002-05-08 03:48 UTC] yohgaki@php.net
> I did find the solution. In IIS there is a CGI timeout function defaulted
> to 300 seconds. THIS MUST BE raised in order for slow dialups to download
> large files. If it is not raised, IIS assumes that the script is done or
> hung and kills it.

Made this to a doc problem.


 [2003-01-18 15:09 UTC] philip@php.net
Anyone have a clue on how or where to document this? All suggestions and ideas welcome :)

It's related to:
Directive: max_execution_time
Function:  set_time_limit
Docs: features.connection-handling

Stated is a default 300 second limit in IIS/CGI, do other web servers and SAPI combinations have such issues?
 [2004-07-26 16:30 UTC] vrana@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.

However, I think this is nothing to do with Timeouts. It's probably some bug in IE causing that if you send Content-Length header, it waits very long. I get it once on HTTPS connection with very similar script to yours. Removing Content-Length solved the problem.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Aug 20 01:01:29 2024 UTC