32MB file uploads - how?

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
didds
Posts: 22
Joined: Jan 18, 2017 11:24 am

32MB file uploads - how?

Post 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

didds
Posts: 22
Joined: Jan 18, 2017 11:24 am

Re: 32MB file uploads - how?

Post 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

atrol
Site Admin
Posts: 7738
Joined: Mar 26, 2008 4:37 pm
Location: Germany

Re: 32MB file uploads - how?

Post 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.
Please use Search before posting and read the Manual

didds
Posts: 22
Joined: Jan 18, 2017 11:24 am

Re: 32MB file uploads - how?

Post 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

atrol
Site Admin
Posts: 7738
Joined: Mar 26, 2008 4:37 pm
Location: Germany

Re: 32MB file uploads - how?

Post 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.
Please use Search before posting and read the Manual

userom
Posts: 2
Joined: Oct 24, 2019 4:53 pm

Re: 32MB file uploads - how?

Post 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.

Post Reply