Question
How to change upload file size limit in Domains > example.com > File Manager?
How to check the maximum size of a file that can be uploaded in Plesk > Domains > example.com > File Manager?
Answer
Increase the default upload file size limit:
-
Connect to the server via SSH
-
Open
/usr/local/psa/admin/conf/php.ini
in a file editor and set required values in bytes. The default value is 2147483647 bytes (=2GB). For example, the following will set the values to 21474836480 (20GB):post_max_size = 21474836480
upload_max_filesize = 21474836480 -
Open
/etc/sw-cp-server/config
and set valueclient_max_body_size
:client_max_body_size 20000m;
-
Restart "psa" service:
# service psa restart
-
Log out from Plesk Interface and log into Plesk again to apply changes
-
Create a directory for custom templates:
# mkdir -p /usr/local/psa/admin/conf/templates/custom/server
-
Copy nginx default template to this directory:
# cp -a /usr/local/psa/admin/conf/templates/{default,custom}/server/nginxPleskAccess.php
-
Modify
client_max_body_size
like the following:# grep client_max_body_size /usr/local/psa/admin/conf/templates/custom/server/nginxPleskAccess.php
client_max_body_size 20000m; -
Reconfigure server template:
# plesk sbin httpdmng --reconfigure-server
These parameters are applied globally to all domains when if comes to uploading files through a Plesk interface in Domains > example.com > File Manager
-
Connect to the server via RDP
-
Open file
C:\Program Files (x86)\Plesk\admin\conf\php.ini
in a file editor and set required values in bytes. The default value is 2147483647 bytes (=2GB). For example, the following will set the values to 21474836480 (20GB):post_max_size = 21474836480
upload_max_filesize = 21474836480 -
Log out from Plesk UI and log in again to apply changes
Comments
5 comments
From https://www.php.net/manual/en/ini.core.php#ini.post-max-size:
Generally speaking, memory_limit should be larger than
post_max_size
.Won't that be a problem as memory_limit is only 256MB in
/usr/local/psa/admin/conf/php.ini
?Plesk File Manager (Linux CentOS 7) keeps giving error 'file cannot be written' when file is > 1GB.
Files just shy of 1GB upload just fine. When the file gets 1GB+ the error 'file cannot be written' gets trown.
Is there maybe a relation with the temporary location where the file is uploaded? Since uploaded files only appear in the target destionation once they are completely uploaded, I assume the files are uploaded to a temporary filesystem place.
Hello, have you tried adjusting post_max_size and upload_max_filesize parameters?
https://support.plesk.com/hc/en-us/articles/12377120745879-Unable-to-upload-any-file-via-domain-File-Manager-after-changing-post-max-size-and-upload-max-filesize-values-The-file-Test-jpg-is-too-big-Try-to-upload-this-file-via-FTP
Hi Anton,
Yes I did, made no difference.
The error isn't 'the file is to big' either, it is 'there was an error ...'.
The file and dir permissions are correct, the settings in the panel php ini are set to 20G.
Please sign in to leave a comment.