I am having trouble understanding how and where to put the code to allow me to upload files that are bigger than 2MB to my Drupal website.

I changed the maximum user upload space to 100MB and each file to 5MB and tried, and when I do, it just hangs.

Someone told me that I need to put some code in to the .htaccess or some PHP file somewhere to allow the PHP to allow bigger than 2MB files, and more than 2MB collectively to be added in the uploads.

Can anyone give me a bit more detail as to where this goes?


mickh’s picture

If your host allows it, you can probably change this in either .htaccess or php.ini with something like this:

upload_max_filesize = 5M (php.ini)

php_flag upload_max_filesize = 5M (.htaccess)

sudofix’s picture

Where is the php.ini located on my server? Also, about what line would I add this to the .htaccess file? Can I just drop it in after the last line?

dman’s picture

view a phpinfo file to see where php.ini is. It can be in a number of places depending on how you installed PHP in the first case. (see the troubleshooting guide or search)

If it's not your server and you are on a shared host, raise a ticket with your sysadmin, as you probably don't have rights to do something as potentiallly painful to a server as make it traffic 100MB files. The default limits were there for a reason.

How to troubleshoot Drupal | http://www.coders.co.nz/

sudofix’s picture

I am on a shared host, and so now that makes sense when you put it that way.

I don't really want to make 100MB files, I was just wondering how to change it, so I can up it to around 5MB total. That's all.

Jason10121’s picture

I'm trying to update Drupal 7.2 to 7.4 and it's larger that 2MB, so I can't update it. How do I do it?