Tuesday, December 21, 2010

Increase the import “file size” in phpMyadmin

SkyHi @ Tuesday, December 21, 2010
The first and only things to check (or ask your host provider to check) are the values of upload_max_filesize (Default 2M)

memory_limit (Default 16M)

and post_max_size (Default 8M)

in the php.ini

increase all as per your need

Then you have to restart the web server


================================================================

Uploading large(big) files in PHP using .htaccess

I’ve seen that many of my friends are struggling with the uploads of the bigger or larger files in PHP. After looking at their struggle, i’m here to solve the problem of uploading larger or bigger files in PHP.
Most of the web servers are configured such a way that a user can only upload the maximum file size of 2MB. So there might be the problem for the people who wants to upload the .pdf file of size around 15MB. But, you can increse the maximum upload file size limit by using .htaccess file.

Here is a small tips for you which you can use to upload such a large file using file field of the form and move_uploaded_file() function in PHP.
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.
php_value upload_max_filesize 20M
php_value post_max_size 20M
php_value max_execution_time 200
php_value max_input_time 200
Now you can upload the file-size up-to 20MB in a simple way using file field in your html form and move_uploaded_file() function available in PHP. In the above .htaccess file, uploading capability is increased by the four parameter first one is maximum file size for uploading, second one is maximum size of the post data , third one is maximum time in seconds a script is allowed to run before it is terminated by the parser and last one is maximum time in seconds a script is allowed to parse input data such as like file uploads, POST and GET data.
You can change the above parameter to upload the bigger file size than 20MB.

 


REFERENCES
http://junal.wordpress.com/2007/10/03/increase-the-import-file-size-in-phpmyadmin/
http://roshanbh.com.np/2008/01/uploading-larger-files-in-php.html