Change the maximum upload file size

private file handling with laravel
How to get a file's extension in PHP?

problem statement

If you have a website hosted on a PC and you have no access to.

You have an upload form allowing people to upload mp3 files up to 30MB big. Your server-side script is done in PHP. Every time you try to upload a file, receive an error claiming that the file exceeds the maximum size allowed, so need to increase the size.

solution 1

You need to set the value of upload_max_filesize and post_max_size in your php.ini :

; Maximum allowed size for uploaded files.
upload_max_filesize = 40M

; Must be greater than or equal to upload_max_filesize
post_max_size = 40M

After modifying php.ini file(s), you need to restart your HTTP server to use the new configuration.

solution 2

You can change it via an .htaccess file.

The following should enable you to increase your upload limit (if the server provider allows PHP config changes via .htaccess).

php_value upload_max_filesize 40M
php_value post_max_size 42M
private file handling with laravel
How to get a file's extension in PHP?
en English
X
Scroll to Top