Page 1 of 1

32MB file uploads - how?

Posted: 05 Jan 2018, 09:59
by didds
mantisBT 2.5.0
mariadb/MySQL 5.5.56-MariaDB
CentOS Linux release 7.4.1708

I've recently implemented mantisbt 2.5.0 as a replacement for our long standing previous 1.2.3. everything is tickety boo.

I then was requested to increase the max upload file size to 8MB - I tweaked the "obvious" parameters and it just worked fine.

I was then asked to increase that to 32 MB. So I tweaked the same things. And.. it sort of works... but doesn't. By that I mean I can upload a file up to 17 MB (17815306 bytes) fine - it adds immediately.

But anything above 17Mb (eg 17.01 MB) doesn't; load - it looks as if it is loadin ie the green swirly bar starts... but never completes.

*sigh*

These are my configurations (FWTW)

/etc/php.ini
post_max_size = 32M
upload_max_filesize = 32M


/var/www/html/config/config_inc.php
$g_max_file_size = 33554432; # 32 MB

I've even tweaked the DB configs too
/etc/my.cnf
$g_allow_file_upload = ON;
$g_file_upload_method = DATABASE; # or DISK DATABASE
$g_max_file_size = 33554432; # 32 MB

also
max_allowed_packet=2048

Has anyone else had any success with altering upload limits to these levels?, or has any idea why >17 MB just "spins" rather than uploading immediately <=17MB

17MB seems such an odd number too!

ian

Re: 32MB file uploads - how?

Posted: 05 Jan 2018, 11:16
by didds
FTR I've n ow also tried

/etc/php.ini
post_max_size = 35M
upload_max_filesize = 35M

as it was suggested to me that I make these a little larger than the mantis limits to provide some overhead. No difference

ian

Re: 32MB file uploads - how?

Posted: 05 Jan 2018, 11:27
by atrol
didds wrote: I've even tweaked the DB configs too
/etc/my.cnf
$g_allow_file_upload = ON;
$g_file_upload_method = DATABASE; # or DISK DATABASE
$g_max_file_size = 33554432; # 32 MB
You added those lines to my.cnf? This would make no sense, maybe you mean config_inc.php
didds wrote: also
max_allowed_packet=2048
For 32MB this should be

Code: Select all

max_allowed_packet = 32M
and is typically set in /etc/mysql/mysql.conf.d/mysqld.cnf

Don't forget to restart the database after such kind of changes.

Re: 32MB file uploads - how?

Posted: 05 Jan 2018, 11:36
by didds
I only changed some parameters in my.cnf for the DB in case that was an issue.
The 2048 was a typo and is indeed 2048M - it needed to be that large to import the DB from its original/previous "home". Its larger than 32MB anyway so should be fine.

As you will see above I've also set various parameters in config_inc.php

$g_max_file_size = 33554432; # 32 MB

and also in /etc/php.ini

post_max_size = 35M
upload_max_filesize = 35M


everything is of course restarted (DB and httpd).

a 17MB file uploads/attaches immediately. A 17.01 MB file doesn't - its just "spins".

ian

Re: 32MB file uploads - how?

Posted: 08 Jan 2018, 14:43
by atrol
To find out if this is a database issue, you could temporarely change the storage to disk.

Code: Select all

$g_file_upload_method = DISK; 
Don't forget to set the upload path in project settings, and run admin/check/index.php to check if all is right.

Re: 32MB file uploads - how?

Posted: 24 Oct 2019, 22:16
by userom
In case you are unable to do, I found hard way on Synology DSM.

Change is required at 3 locations
1> @MantisBT package configuration file (for case of Synology)
\web\mantisbt\config\config_defaults_inc.php
$g_file_upload_method = DATABASE;
$g_max_file_size = 9000000; (I have kept 9MB)

2 @ php.ini (/etc/php/...)
Check these entries
post_max_size = 32M
upload_max_filesize = 32M

3 database configuration (mysql/mariadb)
If there is no "my.cnf" file you can create it
(for Synology NAS) path is /var/packages/MariaDB/etc/my.cnf
and add below lines to the file
-------
[mysqld]
max_allowed_packet = 1073741824
---------
You will need admin privilege to create or modify file. modify file useing $sudo -i vim my.cnf file
Check below link if you need it for Synology
https://www.synology.com/en-sg/knowledg ... nology_NAS

Hope it helps to any one.

Re: 32MB file uploads - how?

Posted: 28 Dec 2020, 12:38
by e_kesaf
Hi,
I am very new in this technical thing.
Is there anyone help me how can I increase file upload limit?

thanks.

Re: 32MB file uploads - how?

Posted: 28 Dec 2020, 14:31
by cas
Check your PHP settings, see here:
https://stackoverflow.com/questions/218 ... -file-size

In Mantis add code below to core\config_inc.php and change value to your liking but ensure that the PHP settings support this also:

Code: Select all

/**
 * Maximum file size (bytes) that can be uploaded.
 * Also check your PHP settings (default is usually 2MBs)
 * @global integer $g_max_file_size
 */
$g_max_file_size = 5000000;