Change Upload Max Size Label on View.php

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
warde06

Change Upload Max Size Label on View.php

Post by warde06 »

I have increased the max file size that can be uploaded and I would like to update the label on view.php where it says:

Upload File
Select File
(Max Size: 2000k)

Any suggestions on how to do this?
warde06

Post by warde06 »

The version is 1.0.0a2.
thraxisp
Developer
Posts: 509
Joined: 14 Feb 2005, 03:38
Location: Ottawa, Canada
Contact:

Post by thraxisp »

The label there is the minimum of three parameters that control the size of the upload. You may need to change all of them to actually increase the upload size. See http://www.futureware.biz/blog/index.ph ... &tb=1&pb=1 for more details.
warde06

Post by warde06 »

I believe that I have changed all of those. My settings are below, but when I view the bug it still says (Max Size: 2000k) and of course that is the max that I can upload. I have read through the manual and forums regarding this, but I am still missing something. Your help is greatly appreciated!

In /etc/php.ini I have changed the following:
; Maximum size of POST data that PHP will accept.
post_max_size = 50M

; Maximum allowed size for uploaded files.
upload_max_filesize = 50M

; Resource Limits ;
max_execution_time = 120
max_input_time = 120
memory_limit = 32M

In config_inc.php I have changed the following:
# See also: $g_upload_project_file_threshold, $g_upload_bug_file_threshold,
# $g_allow_reporter_upload
$g_allow_file_upload = ON;

# Upload destination: specify actual location in project settings
# DISK, DATABASE, or FTP.
$g_file_upload_method = DISK;

# Maximum file size that can be uploaded
# Also check your PHP settings (default is usually 2MBs)
$g_max_file_size = 50000000; # 50 MB
thraxisp
Developer
Posts: 509
Joined: 14 Feb 2005, 03:38
Location: Ottawa, Canada
Contact:

Post by thraxisp »

Have you restarted apache to pick up the changed in the php.ini file?
swati
Posts: 1
Joined: 20 Mar 2014, 12:01

Re: Change Upload Max Size Label on View.php

Post by swati »

I have done all the necessary changes required to increase file size in mantis bt

changed the php.inc file
upload_max_filesize=2M;
to
upload_max_filesize=4M;
Maximum size of POST data that PHP will accept.
post_max_size = 50M

; Maximum allowed size for uploaded files.
upload_max_filesize = 50M

; Resource Limits ;
max_execution_time = 120
max_input_time = 120
memory_limit = 32M

In config_inc.php I have changed the following:
# See also: $g_upload_project_file_threshold, $g_upload_bug_file_threshold,
# $g_allow_reporter_upload
$g_allow_file_upload = ON;

then restarted the xampp and the try uploading 2.5 mb file getting error

Database query failed. Error received from database was #2006: MySQL server has gone away for the query: INSERT INTO mantis_bug_file_table
( bug_id, title, description, diskfile, filename, folder, filesize, file_type, date_added, content, user_id )
VALUES
( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? ).


please help me out.
atrol
Site Admin
Posts: 8366
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Change Upload Max Size Label on View.php

Post by atrol »

Check database setting max_allowed_packet in my.cnf

You might also consider to store attachments on disk instead of storing them on database.
See $g_file_upload_method at http://www.mantisbt.org/docs/master-1.2 ... IG.UPLOADS
Please use Search before posting and read the Manual
micky
Posts: 1
Joined: 02 May 2014, 14:35

Re: Change Upload Max Size Label on View.php

Post by micky »

I have changes the max_allowed_packet parameter from 25M to 50M and now I can load files without the error reported.
Version of mantis that I have installed is 1.2.17
asgharb
Posts: 12
Joined: 15 Aug 2018, 06:26

Re: Change Upload Max Size Label on View.php

Post by asgharb »

micky wrote: 02 May 2014, 16:50 I have changes the max_allowed_packet from 25M to 50M and now I can load files without the error reported.
Version of mantis that I have installed is 1.2.17
where is ((max_allowed_packet)) ?
atrol
Site Admin
Posts: 8366
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Change Upload Max Size Label on View.php

Post by atrol »

asgharb wrote: 01 Sep 2018, 07:52 where is ((max_allowed_packet)) ?
atrol wrote: 20 Mar 2014, 12:57 Check database setting max_allowed_packet in my.cnf
https://stackoverflow.com/questions/248 ... f-location
Please use Search before posting and read the Manual
Post Reply