Gaz Smith
Gaz Smith

Reputation: 1108

File upload 404 error on server

I have a PHP file up-loader that we use to upload around 10-15 5mb images every day. I have the image uploader locally and i can upload images fine. I changed all the settings in my php.ini to ensure than i had the correct limits.

Now, i have put the up-loader on a windows server and it has the same settings, but sometimes (not always) when i upload 10-15 images it gets to 97 percent and throws a 404 document not found error.

Does anyone have any ideas as to why this could happen? I have been trying to sort this for days it is really frustrating. I'musing php 5.6 on iis.

Upvotes: 3

Views: 6812

Answers (2)

zmonteca
zmonteca

Reputation: 2354

For me it turned out to be neither of the PHP or any settings for maximum filesize setting in php.ini.

The IIS on the other hand limited the post upload size.

  • To change go to your website in the IIS Manager
  • Click on Request filtering
  • In the right pane select Edit Feature settings
  • Change the Maximum allowed content length to your desired byte length which is the maximum value (we used 100MB or 104857600 bytes)

Upvotes: 1

Egg
Egg

Reputation: 1769

IIS returns a 404 error when a POST length is too large:

HTTP Error 404.13 - CONTENT_LENGTH_TOO_LARGE

You'll need to increase the file upload limit using the parameter:

requestLimits.maxAllowedContentLength

Details of both of these items are on the IIS website: https://www.iis.net/configreference/system.webserver/security/requestfiltering/requestlimits

Upvotes: 6

Related Questions