You are hereBlogs / dave's blog / Increasing Drupal's File Size Upload Limit

Increasing Drupal's File Size Upload Limit


By dave - Posted on 03 September 2009

Image UploadBy default, most Drupal setups have an upload file size limit of 2 megabytes. That's enough for uploading most content like images and short Word documents and PDF files. But start uploading larger files like audio or video, and you'll quickly run into this frustrating upload limit. Some video files can be hundreds of megabytes! Here's how you can get around the limit.

First, Modify Drupal

  1. Go to your Admin menu. Under Site Configuration, select File Uploads
  2. Find the Default maximum file size per upload and set it to 128mb

Second, Modify Apache

  1. Find your php.ini file. On my machine, this is located at /etc/php5/apache2/php.ini
  2. Find upload_max_filesize and change it so it reads:
    upload_max_filesize = 128M
  3. Find post_max_size and change it also:
    post_max_size = 128M
  4. Restart apache

Yay, you should be able to upload huge files now! Make sure you set your up your per-user upload settings if you want non-admin users to be able to upload huge files.

Alternate Apache Option: Edit your .htaccess file

If you don't have access to your php.ini file, you should be able to set the php options in your .htaccess file using the following syntax:

php_value upload_max_filesize 128M
php_value post_max_size 128M

There doesn't seem to be a File Uploads place in Site Configuration.

I added the values suggested in the .htaccess file, but this made no difference.

Any thoughts Dave?

Robert

Are you running Drupal 6? Have you enabled the Upload module on the module configuration page?

Dear Dave,

We are two people creating a website for a project using Drupal. Yesterday we were trying to upload a .pdf file which was considerably bigger than the 2MB allowed by default. So I ran across your website and my colleague tried to modify the .htaccess file, according to your instructions. Sth. must have happened because since then we are not able to access the admin node anymore and we are getting this 'Error 500 - Internal server error' message.

Since we're completely desperate about the situation (we have been busting our backs to create the content on the site for the last 2 weeks), I am hereby contacting you to ask for help.

Thank you very much in advance!

All the best,
Monica Z.

Happy to help, please contact me.

Thanks,

Dave

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

Tags associated with this post

About dave

dave's picture

Name
Dave Nugent

Bio

Dave is a freelance Drupal developer working in the San Francisco bay area. He recently graduated from Carnegie Mellon University Silicon Valley. In his spare time he docents at the Computer History Museum. Follow Dave on Twitter @drnugent.