Page 1 of 1

Timeout's while uploading

Posted: Tue Aug 02, 2005 3:42 am
by hellfish
Hi, I've been cracking my head with this one, the script worked fine before updating PHP to v5.0.4, now all I get is the 30 seconds Timeout.

This is my php.ini

Code: Select all

;;;;;;;;;;;;;;;;
; File Uploads ;
;;;;;;;;;;;;;;;;

; Whether to allow HTTP file uploads.
file_uploads = On

; Temporary directory for HTTP uploaded files (will use system default if not
; specified).
;upload_tmp_dir = C:\PHP\uploadtemp  ; temporary directory for HTTP uploaded files (will use system default if not specified)

; Maximum allowed size for uploaded files.
upload_max_filesize = 4M
does anyone have any ideia of what I could do to fix this?

Posted: Tue Aug 02, 2005 4:21 am
by s.dot
take a look at set_time_limit, setting your time in seconds.

set_time_limit(0); would make the script execution time unlimited, unless you're running PHP in safe mode.. In which case you'd have to include max_execution_time amd max_input_time values in your php.ini file.

Posted: Tue Aug 02, 2005 7:02 am
by feyd
there is a posting time limit setting as well.. check into that: http://php.net/features.file-upload

Posted: Tue Aug 02, 2005 10:43 am
by hellfish
I could really try that but do you think that it would be usefull?

I mean the script worked before and I'm trying to upload imagens with sizes smaller than 100Kb

My belief is that it migth be something that the PHP 5.0.4 windows installer did not configure correctly, but what would that be?


I've been using FTP method but I also tried this

Code: Select all

<form action="" method="post" enctype="multipart/form-data">
<p>Pictures:
<input type="file" name="pictures[]" />
<input type="file" name="pictures[]" />
<input type="file" name="pictures[]" />
<input type="submit" value="Send" />
</p>
</form>

Code: Select all

<?php
foreach ($_FILES["pictures"]["error"] as $key => $error) {
   echo "<br>aqui vai um...";
   if ($error == UPLOAD_ERR_OK) {
   echo " " . $_FILES["pictures"]["name"][$key] . " temp: " . $_FILES["pictures"]["tmp_name"][$key];   
       $tmp_name = $_FILES["pictures"]["tmp_name"][$key];
       $name = $_FILES["pictures"]["name"][$key];
       if (move_uploaded_file($tmp_name, "httpdocs/temp/$name")) {
	   	echo " ... concluido";
	   } else {
	   	echo " ... não deu";
	   }
   }
}
?>

And watching the windows temp directory I see that the files are uploaded there but they don't get moved to the correct directory