This topic describes how to modify the PHP and IIS maximum upload file size on the web server.
PHP changes
To change the file upload file size maximum for a web application instance, complete the following steps:
- Locate the server file .user.ini. This is typically located in C:\inetpub\wwwroot\<site folder>\.user.ini.
- Open the file and locate the entry
upload_max_filesize
. If this option does not exist in the file, you can manually add it to a new line. - Change the value to the maximum upload size that you want to set for the instance. The following examples display the syntax for specifying kilobytes, megabytes, and gigabytes:
upload_max_filesize = 500K
upload_max_filesize = 10M
upload_max_filesize = 5G
- Save the file.
IIS changes
Modifying the PHP configuration alone will allow users to upload files up to 28MB in size. To upload larger files, complete the following steps in IIS.
- In IIS, go to the Connections pane and select the server node.
- In the middle pane, under the IIS section, click Request Filtering.
- In the right pane, select Edit Feature Settings.
- Set the value for the maximum allowed content length in bytes. To convert Mb to Bytes multiply by 1,048,576.
- Click OK.
Additional information
Changing the maximum file upload size can also be done from the file php.ini, which is typically located in C:\Program Files\PHP\v7.3\php.ini. Making the change in this location however, will impact all web application instances on the web server running that instance of PHP. Changing the .user.ini file allows you to control the maximum upload size for each individual instance.
Also note that if there are conflicting entries in both .user.ini and php.ini, the instance will default to the value specified in .user.ini.
The Request Filtering settings can be set on a per site basis. In step 1. of the IIS instructions, select the specific site from the “Connections” pane instead of the server node.