SOLVED [cPanel UAPI] The file “/home/username/public_html/FILE for user “username” is larger then the maximum allowed file size of 1 MB.

cPanel & WHM Version
v100.0.12

VPSExpert

Active Member
Dec 15, 2010
38
2
58
Pakistan
cPanel Access Level
Root Administrator
Hello,

I am trying to get the content of a file using cPanel API but any file larger than 1MB is throwing the following error.
Error: The file “/home/username/public_html/FILE_NAME.log” for user “username” is larger then the maximum allowed file size of 1 MB.

I don't know what are the relevant settings for downloading a file through API but I have increased all the file sizes settings to more than 200MB.

Any help in this regard is appreciated.

Thanks.
 

VPSExpert

Active Member
Dec 15, 2010
38
2
58
Pakistan
cPanel Access Level
Root Administrator
Hi cPRex,

Thanks for your reply.

I am using Return File Content API (Return file content · cPanel & WHM Developer Portal) to retrieve file contents. And this is the request payload I am sending:

API URL: https://[server url]:2087/json-api/cpanel
Request Payload: Array
(
[api.version] => 1
[cpanel_jsonapi_apiversion] => 3
[cpanel_jsonapi_module] => Fileman
[cpanel_jsonapi_func] => get_file_content
[cpanel_jsonapi_user] => [username]
[cpanel_username] => [username]
[dir] => /home/[username]/public_html/var/logs/
[file] => [File Name].log
)
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
17,470
2,843
363
cPanel Access Level
Root Administrator
I did confirm with our team that the File Manager tools are limited to 1M in the size of files they can process, as this is generally a tool that should be limited to human-readable text.

I created three cases related to the issues mentioned here:

-one for the 1M issue, as we need to make that clear in the documentation page
-one for "then" vs "than"
-one for the typo in the example where it shows "public.html" instead of "public_html"

Thanks for bringing this up, @VPSExpert !!!