Monthly Archives: July 2012

How to uploading large(big) files in PHP using .htaccess

Usually, default upload size from a web browser is 2 MB and if this is required to be changed, you can do it using .htaccess file.

  1. Create a .htaccess file in the root folder of web server.
  2. Put the following code in side the .htaccess file and save it.
  3. If the .htaccess file already exists, add the above code to the already existing file.
  4. Make sure there are no blank spaces at the end of the file.

php_value upload_max_filesize 20M
php_value post_max_size 20M
php_value max_execution_time 200
php_value max_input_time 200

Note: Some servers do not allow to change file upload size using .htaccess so Internal Server Error may appear in this case.