File Upload Help, Please

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
fstrnu
Forum Newbie
Posts: 11
Joined: Fri Dec 19, 2003 9:11 am

File Upload Help, Please

Post by fstrnu »

When trying to upload a file > 3MB, I get the 'page cannot be displayed' error after ~5min. The hosting company tech support say they are able to upload files > 3MB, so we think it is a timeout problem.

Relevant PHP settings that I am aware of are:

post_max_size = 15M
upload_max_filesize = 10M
max_execution_time = 900
max_input_time = 900

They also said that their IIS timeout is set to 300s and I think they bumped it up to 900s as well.

Is there something else we can be trying?? Many thanks in advance!!!!

Here is the code I am using for the upload:

<?php

if (!$_POST['submit']) {

?>
<form enctype="multipart/form-data" action="fileupload.php" method="POST">
file: <input name="userfile" type="file">
<input type="submit" value="Send" name="submit">
</form>

<?
}
else {

$uploaddir = 'd:\\html\\users\\183493\\html\\Upload\'';
$uploadfile = $uploaddir. $_FILES['userfile']['name'];

print "<pre>";

if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
print "valid, and success.";
print_r($_FILES);
}
else {
print "nope.";
print_r($_FILES);
}

print "</pre>";

}
?>
User avatar
phpScott
DevNet Resident
Posts: 1206
Joined: Wed Oct 09, 2002 6:51 pm
Location: Keele, U.K.

connection speed

Post by phpScott »

A lot will depend on the speed of the internet connection that the person using the file upload has.
Dail up will take a heck of a lot of time for a 3mb file compared to some one who has cable or dsl.

And there is no way around that.

phpScott
fstrnu
Forum Newbie
Posts: 11
Joined: Fri Dec 19, 2003 9:11 am

Re: connection speed

Post by fstrnu »

Agreed. However I am the one testing it and it gives me the error after only 5min when the timeout is set to 900s or 15 min. Any other ideas? Thanks again for taking the time to reply...
phpScott wrote:A lot will depend on the speed of the internet connection that the person using the file upload has.
Dail up will take a heck of a lot of time for a 3mb file compared to some one who has cable or dsl.

And there is no way around that.

phpScott
ex247
Forum Commoner
Posts: 34
Joined: Tue Oct 28, 2003 1:35 am
Location: Boston, MA, USA
Contact:

Post by ex247 »

it could be the process timeout of the server
fstrnu
Forum Newbie
Posts: 11
Joined: Fri Dec 19, 2003 9:11 am

Post by fstrnu »

Thanks for your reply. The server is IIS and they say that the timeout is set at 900 seconds. Any other ideas? Is anyone out there successfully uploading files > 8MB using PHP that might be able to help?
Post Reply