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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Uploading files of size 2

Status
Not open for further replies.

LTeeple

Programmer
Joined
Aug 21, 2002
Messages
362
Location
CA
Dear colleagues,
Once again, I defer to your expertise.

I am attempting to upload files of size to my server and keep getting a page not found error for files > 5M.

Here's my config:
PHP: upload_max_filesize: 12M

In my form code I allow for a max of 10M:
Code:
<input type="hidden" name="MAX_FILE_SIZE" value="1024000">
<input name="photo" type="FILE" size="50">

It is important to note that when I upload files of <5M, it works just fine. But when they're > 5M, I get a 'page not found' error.

Any ideas?


[cheers]
Cheers!
Laura
 
Do you get a "page not found" error immediately?

What browser are you using?
With what web server are you running PHP?


Want the best answers? Ask the best questions!

TANSTAAFL!!
 
I knew I was leaving some vital info out...

The actual page I get is 'Cannot find server' page cannot be displayed, and yes, it appears immediately.

I am using: IE 6.0.2800.1106.xpsp2...
My server is: Apache 2.0.40

Do you suspect this to be a server config issue?

Thanks for your quick response

[cheers]
Cheers!
Laura
 
Oops one more thing: (sorry!)
I know for sure the page exists, 'cause when I click 'refresh' and the page loads.

FYI: The page I'm talking about is the form handler page called 'save.php'. It accepts the form posted data and processes the database update, and file upload.

So when I click on 'refresh', the save.php page is then 'found' but no file handling or database update has taken place, nor am I prompted to 'resend data' as is typical for refreshing a php page.

[cheers]
Cheers!
Laura
 
Your sounding an awful lot like your browser is refusing to send the file of a given size. Of course, that's mostly going from the immediately issue.

The only other thing which would come to mind (but doesn't work with the immediate concept) is that your script is timing out during the upload, in which case you'd want to tinker with set_time_limit();

Have you tried alternatve browsers to see the behavior?
 
Hi,
I just tried in NN7.1 and FireFox. Upon attempting to submit to both pages I get the following alertbox:
"Document contains no data". - Pretty ambiguous!

Any help is mucho appreciated.

[cheers]
Cheers!
Laura
 
Check the value "post_max_size" in php.ini. Is this value larger than "upload_max_filesize"? It needs to be.

There's also an Apache runtime configuration directive which limits the amount of data that can be sent with a POST. I'm having trouble finding it right now.


Want the best answers? Ask the best questions!

TANSTAAFL!!
 
Okay,
now my php config is as follows:
post_max_size: 14MB
upload_max_filesize: 12MB

I've restarted the httpd service, and still no dice...

Just to make absolutely sure it's working, I just tested it again with a smaller file, and it works correctly, so it still seems to be a filesize issue.

I appreciate all your help!

[cheers]
Cheers!
Laura
 
Alright, I figured it out...

There was a file in my httpd/conf.d/ directory called php.conf

in the directive
Code:
<Files *.php>
  SetOutputFilter PHP
  SetInputFilter PHP
  LimitRequestBody 524288
</Files>
I just changed LimitRequestBody to 1024000 and restarted my server.

Thanks to sleipnir214 and skiflyer for your help :)

[cheers]
Cheers!
Laura
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top