ID: 14827
Updated by: georg
Reported By: [EMAIL PROTECTED]
Old Status: Open
Status: Bogus
Bug Type: HTTP related
Operating System: windows 2000
PHP Version: 4.1.0
New Comment:

Try to use set_time_limit() function to prevent timeouts.



Previous Comments:
------------------------------------------------------------------------

[2002-01-03 10:15:19] [EMAIL PROTECTED]

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; 
} 
?>

------------------------------------------------------------------------



Edit this bug report at http://bugs.php.net/?id=14827&edit=1


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to