Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

file upload not working

Status
Not open for further replies.

TruthInSatire

Programmer
Aug 12, 2002
2,964
US
We're having a problem uploading large files via our web form on our website. The site uses a framework and scripts that the webmaster didn't write. the problem is a user friendly message comes back saying to choose another file.

I wrote a basic upload script just to see if i could get any actual errors. here is the script, it more or less came from the php website.

Code:
?php
$uploaddir = 'c:/apachefriends/xampp/htdocs/travisUploadTest/';
$uploadfile = $uploaddir . basename($_FILES['uploadFile']['name']);
echo '<pre>';
move_uploaded_file($_FILES['uploadFile']['tmp_name'], $uploadfile);
echo 'Here is some more debugging info:';
print_r($_FILES);
print "</pre>";

?>

the problem is when I upload a large file, say 60 megs, I don't get any php errors but the "rint_r($_FILES)" line only shows "Array()" How can I find out if this is a timeout issue or resource problem of somekind. Thanks.

We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true.
 
What does your HTML form that contains the file input look like? Specifically, have you verified the methoc and enctype attributes?

Want the best answers? Ask the best questions!

TANSTAAFL!!
 
Thanks for the reply. small files upload just fine. I've uploaded as much as 5 megs. I haven't tried anything between 5 and 60 so i can't say 5 megs is the max that will upload. The other script with the friendly message has uploaded 14 megs successfully (intermitently)

Code:
<form name = "upload" action = "upload.php" enctype="multipart/form-data" method = "post">
<input type = "file" name = "uploadFile" size = "50" />
<br />
<input type = "submit" value = "Upload File" />
</form>

php.ini
time out = 20 minutes
max upload = 80mb

We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true.
 
some other information. This is running on a PC with windows XP. This is not a 'web server' with server software. Its running apache web server. hard drive has 3gig of hard disk space available and 384 megs of ram

We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true.
 
Some more things to check:

In php.ini, check the value for upload_max_filesize. PHP won't accept a file larger than that value.

The Apache runtime configuration directive LimitRequestBody can also limit the amount of data which can be sent to the browser.

Want the best answers? Ask the best questions!

TANSTAAFL!!
 
upload_max_filesize = 800M

where is the apache runtime config?

We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true.
 
I don't know where the file resides on Win32 Apache installations. Look for a file named [tt]httpd.conf[/tt].


Oops. I forgot the php.ini directive post_max_size.

Want the best answers? Ask the best questions!

TANSTAAFL!!
 
post_max_size = 800M

I can't find LimitRequestBody httpd.conf

We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true.
 
If the directive is not in httpd.conf, then the default value is "no limit". Don't worry about it.

It's not limits set by directives in php.ini or httpd.conf, then.

Let's look at time to upload. How long does your browser take to upload the large file to the server?

Want the best answers? Ask the best questions!

TANSTAAFL!!
 
don't you need to include a max_upload field in the html form itself otherwise a default is used?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top