You can increase the maximum file size for uploads in PHP by modifying the upload_max_filesize
and post_max_size
directives in your php.ini
file. These values limit the maximum size of a single uploaded file and the maximum amount of data that can be sent in a POST request, respectively.
Here's an example of how you can set the maximum file size to 10MB in your php.ini
file:
146 chars6 lines
If you don't have access to the php.ini
file, you can also modify these values in your PHP script using the ini_set
function:
main.php105 chars4 lines
Keep in mind that increasing the maximum file size can have consequences on your server's performance and security, so make sure to test your application thoroughly and handle file uploads carefully to avoid any issues.
gistlibby LogSnag