How to change the maximum upload file size for your website

January 18, 2024 / How-to Guide

This guide explains how to change the maximum upload file size for your website.
You can restrict large file uploads on your site by modifying the upload_max_filesize and post_max_size directives in a .htaccess file.

Follow the steps-

  1. Log in to your account using SSH.
  2. Insert the following line into the .htaccess file using a text editor, replacing “xx” with your desired maximum upload file size in megabytes-
    php_value upload_max_filesize xxM
  3. Insert the subsequent line into the .htaccess file, substituting “xx” with your preferred maximum HTTP POST file size in megabytes-
    php_value post_max_size xxM
    For continuous file uploads, it is advisable to set the post_max_size directive slightly higher than the upload_max_filesize. For instance, for a 20-megabyte file upload limit, set upload_max_filesize to 20M and post_max_size to 21M.
  4. Save the modifications to the .htaccess file and close the text editor.
  5. To confirm the activation of the updated setting, generate a PHP test file with the following code in the directory where the .htaccess file resides-
    <?php phpinfo(); ?>
  6. Open the test file in your web browser, and search for the directive name. Check the Local Value column to confirm that it displays the updated setting specified in the .htaccess file.

This method allows you to adjust the maximum upload file size for your website. Moreover, for better Plesk server management you can also increase the maximum upload file size for Plesk. If assistance is required, feel free to contact our support team at any difficult moment.

Dominos Search