By default mantis ( or used to) save files in database (MySQL here).
One fellow here tried to upload a 2MB PDF file and got an “APPLICATION ERROR #401“.
Googling for the problem it was suggested to check for $g_max_file_size in Mantis configuration upload_max_filesize in php.ini, both configurations were set to 10MB ( by default mantis is 5 MB).
The real culprit was MySQL configuration max_allowed_packet, in my server this option max_allowed_packet as 1 MB.
To set this variable to 10MB without stopping the server, log into MySQL with proper root permissions and follow as:
SET GLOBAL max_allowed_packet=10485760;
where 10485760 is 1024*1024*10