How to upload files which are larger than 2 MB
If you want to upload files using PHP to a server which are larger
than 2 MB and there is a limit (e.g. 2 MB) on the server, you can do
following steps:
See your PHP Info - create file called e.g. info.php and add following php code to this file:
<?php
echo phpinfo();
?>
Run this file on your server and you will see all PHP settings
See upload_max_filesize directive
It is your server:
If there is only 2M (2 MB), you should increase your upload filesize in your php.ini
Open your php.ini (linux: /etc/php.ini, windows: C:\WINDOWS or C:\WINNT) and change or add the following piece of code:
;;;;;;;;;;;;;;;;
; File Uploads ;
;;;;;;;;;;;;;;;;
; Maximum allowed size for uploaded files
upload_max_filesize = 4M
Save your php.ini and restart your server
It is not your server:
Try to add the following code to your index.php file (or your main script file):
<?php
ini_set('upload_max_filesize', '4M');
?>
If it doesn't work, you must contact your server support.
How to upload files which are larger than 2 MB
- Details
- Written by: Matthew Murphy
- Category: How-To Guides
- Hits: 26
