Cobra Forum

Plesk Panel => Webserver => Topic started by: Suhitha on Feb 23, 2026, 07:26 AM

Title: Unable to attach files in a WebMail or any file upload when ModSecurity is
Post by: Suhitha on Feb 23, 2026, 07:26 AM
Question: Unable to attach files in a WebMail or any file upload when ModSecurity is active: An error occurred! File upload failed

Applicable to:



Symptoms


An error occurred! File upload failed

Server error! (Request Entity Too Large)



# tail -f /var/log/httpd/error_log
[:error] ModSecurity: Request body (Content-Length) is larger than the configured limit (13107200). [hostname "webmail.example.com"] [uri "/"] [unique_id "Wvm2-f069f312c27e"], referer: http://webmail.example.com/?_task=mail&_action=compose&_id=123456789abcdefgh

# egrep -Ri SecRequestBodyLimit /etc/httpd/conf.d/mod_security.conf
SecRequestBodyLimit 13107200


Cause

Upload file process fails because ModSecurity SecRequestBodyLimit is reached.


Resolution

1.Log in to Plesk

2.Navigate to Tools & settings > Web Application Firewall (ModSecurity) > Settings:

3.Add the following line into the text field Custom directives:

SecRequestBodyLimit 67108864
4.Press Apply