php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #14827 POST [file upload] timeout in browsers
Submitted: 2002-01-03 10:15 UTC Modified: 2002-01-03 10:53 UTC
Votes:2
Avg. Score:2.0 ± 1.0
Reproduced:1 of 2 (50.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: michael at antipersonnel dot org Assigned:
Status: Not a bug Package: HTTP related
PHP Version: 4.1.0 OS: windows 2000
Private report: No CVE-ID: None
 [2002-01-03 10:15 UTC] michael at antipersonnel dot org
i am attempting to have users upload files from their computer to my web server. i seem to be experiencing a timeout in both IE and NN. i have changed the server and php.ini settings accordingly, but timeouts still occur.

i have gone through many lists and forums looking for an answer, and while i notice people posting they can upload
[quite] large files, no one details the network environment [ie., intra/internet], browser, web server, client machine, etc.  i am sure someone out there is experiencing timeouts in both IE and NN when attempting to upload large files.

i can upload files fine, until the filesize is greater than what i can upload within the timeout. IE times out at about 5 minutes, and NN varies around there. so far, the largest file i have been able to upload was about 10MB or so, on a
t1.

i have tried the ReceiveTimeout registry entry for IE, but it does NOT work in IE6.

i have a prefs.js entry for NN that might work, but have to wait until tonight to test it out.

now, i know it is the browser that is timing out [at home at least].  is there a way to keep sending pertinent info to the browser during a copy() function, in order to keep the connection alive, and not have the browser timeout?

or, is there another way to do a file upload via the broswer, that won't time out?  i cannot tell is this is a php bug, a browser bug, or just plain old operator headspace.  thanking you in advance.

sincerely, 
michael defrees


here are my current settings:

server: 
win2k adv server 
IIS 5 
php 4.1.0 

webserver settings: 
connection timeout = 1800 

php.ini settings:
max_execution_time = 1800 
memory_limit = 50M 
post_max_size = 50M 
file_uploads = On 
upload_tmp_dir = c:\php\upload_temp 
upload_max_filesize = 50M 







the page is here:
http://www.antipersonnel.org/ordnance/musicbox/upload.php 

please do not be malicious, the error handling was removed in order to debug the timeout.

files uploaded will be located here: 
http://www.antipersonnel.org/index.php?directory=upload 



here is the code:

<? 
$sizelimit = "no"; 
$sizebytes = "200000"; 
$dl = "http://www.antipersonnel.org/ordnance/musicbox/upload"; 
$absolute_path = "d:/inetpub/wwwroot/antipersonnel.org/upload"; 
$websiteurl = "http://www.antipersonnel.org"; 
$websitename = "antipersonnel.org"; 

switch($action) { 
default: 
echo" 

<head> 
<title>upload</title> 
</head> 
<body> 
<a href=$PHP_SELF?action=upload>Upload File</a> 
<a href=$websiteurl>Return to $websitename</a> 
</body> 
"; 
break; 

case "upload": 
echo" 

<head> 
<title>upload</title> 
</head> 
<body> 
<form method=POST enctype=multipart/form-data
action=$PHP_SELF?action=doupload>
<p>File to upload:<br> 
<input type=file name=file size=30> 
<p><input value=submit name=submit type=submit> 
</form> 
</body> 
"; 
break; 


//File Upload 
case "doupload": 
$dir = "dir"; 
if ($file != "") { 
if (file_exists("$absolute_path/$file_name")) { 
die("File already exists"); 
} 
if (($sizelimit == "yes") && ($file_size > $sizebytes)) { 
die("File is to big. It must be $sizebytes bytes or less."); 
} 
copy($file, "$absolute_path/$file_name") or die("The file you are
trying to upload couldn't be copied to the server");
} else {  die("Must select file to upload"); 
} 
echo " 

<head> 
<title>uploaded</title> 
</head> 
<body>"; 
echo $file_name." was uploaded"; 
echo "<br> 
<a href=$PHP_SELF?action=upload>Upload Another File</a> 
<a href=$websiteurl> Return to $websitename</a> 
</body> 
"; 
break; 
} 
?>

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-01-03 10:53 UTC] georg@php.net
Try to use set_time_limit() function to prevent timeouts.


 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Thu Feb 25 19:01:24 2021 UTC