I am having a weird problem with uploading large files in the Drupal admin's file field. I have the size limit set to 500 MB. I also have the php.ini settings for upload size, post size, and memory all set to 500 MB.

When I upload a smaller file like 50 MB everything works perfectly. If I upload a larger file such as 250 MB then the upload fails immediately and I get a 404 error in the Network tab of the Chrome inspector.

The 404 error is on this URL: http://example.com/file/ajax/field_video_file/und/0/form-tpohUDjq_v0b7OcNhtnQl2TaRc5UcFl9zwJQzI3mlwE

The server is running IIS 7.5.

Any ideas what could be causing this?



From: https://www.drupal.org/node/97193

Drupal's limits on upload file size are determined by your server's PHP settings (as well as Drupal specified settings that can be set at Admin > Site Configuration > File Upload). The default values for PHP will restrict you to a maximum 2 MB upload file size.

On the settings page for the upload module, Drupal calculates and displays the maximum file size that you can set based upon two PHP settings: 'post_max_size' and 'upload_max_filesize'. Since 'post_max_size' is the limit for all the content of your post, many people choose 'post_max_size' to be a multiple of 'upload_max_filesize' to allow multiple files to be uploaded, but this is not essential. The upload module limits the size of a single attachment to be less than either post_max_size, or upload_max_filesize, whichever is smaller. The default PHP values are 2 MB for upload_max_filesize, and 8 MB for post_max_size.

Depending on your host, changing these two PHP variables can be done in a number of places with the most likely being php.ini or .htaccess (depending on your hosting situation).

For example, to increase the limit on uploaded files to 10 MB:

Add the below to the relevant php.ini file (recommended, if you have access). Note that for some hosts this is a system-wide setting.

However, for hosts running PHP as a CGI script with suexec (for example) you may be able to put these directives in a php.ini file in your Drupal root directory. upload_max_filesize = 10M post_max_size = 10M Add the below to your .htaccess file in your Drupal root directory. php_value upload_max_filesize 10M php_value post_max_size 10M

The PHP documentation states that the memory_limit setting also affects file uploading. Generally speaking, memory_limit should be larger than post_max_size. If this is an issue, see the page on how to Increase memory available to PHP (3 methods)

Drupal also allows/enforces its own size limits, independently of what PHP allows. These are found in Drupal 6 at "Administer » Site configuration » File uploads" ( /admin/settings/uploads ). In Drupal 7 size limit is controlled on per-field basis. The Drupal settings cannot be larger than those permitted by PHP, but may be smaller if you haven't updated them, so remember to check there also, after updating the php.ini.

Also, make sure your permissions are set correctly from your public/private folders you've set Drupal for file handling. The folders are located at /admin/config/media/file-system

  • Thanks, that took me in a good direction. Now the file appears to upload the whole way, instead of stopping immediately, but now I get a 500 error when the upload is finished and the file does not get placed on the server. I wish I could figure out a way to get more details on that 500 error :(
    – Dustin
    Oct 16 '14 at 15:44
  • Check your permissions. Oct 16 '14 at 15:48
  • I'll modify my answer to include of some the content from the article and some issues that may help in a few minutes. Oct 16 '14 at 15:49
  • I'm having the exact issue. IIS Server with Drupal 7. Everything worked fine but recently I started getting the 500 error once the upload completes. We were having network issues and now that those are resolved, I cannot even get the upload to start. I immediately get the 404 error for form-...
    – sho
    Aug 24 '16 at 13:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.