Skip to main content

AddToAny

Share/Save

How to Increase the size of File Attachment in Drupal

1 reply [Last post]
vaibhav
vaibhav's picture
User offline. Last seen 5 days 9 hours ago. Offline
Joined: 08/19/2009

I am attaching a file in a node in drupal using File Attachment. But it is not allowing me to upload a file greater than 1MB. I want to upload a file of 50MB. How to increase this size. Thanks in advance.

vaibhav
vaibhav's picture
User offline. Last seen 5 days 9 hours ago. Offline
Joined: 08/19/2009
Answering my own question.

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 = 50M
  • post_max_size = 50M

Add the below to your .htaccess file in your Drupal root directory.
 

  • php_value upload_max_filesize 50M
     
  • php_value post_max_size 50M