Mantis Logo
Mantis Manual
Manual
Configuration

Database
Path
Webserver
Version
Email
Language
Display
Time
JpGraph
Date
News
Default Preferences
Summary
Bugnote
File Upload
HTML
Authentication
Status Settings
Filters
Misc
Colors
Cookies
Database Tables
Speed Optimisation
Reminders
Bug History
Sponsorship
Source Control Integration
Custom Fields
My View Settings
Relationships
System Logging


Partner Links


File Upload
Last Modified: August 5, 2003 07:08AM
(Any)
Description

Mantis allows users to upload file attachements and associated them with bugs as well as projects. Bug attachments / project documents can be uploaded to the webserver, database, or an FTP server. When bugs are uploaded to the webserver they are uploaded to the path that is configured in the project properties.

In case of problems getting the file upload feature to work, check the following resources:
$g_allow_file_upload Whether to allow/disallow uploading of attachments. Default value is ON.
$g_file_upload_method Specify the location for uploading attachements. This can be DISK, DATABASE, or FTP. In case of FTP, the files are saved on the webserver (same as disk) as well as on the specified FTP server. Default value is DATABASE.

In case of DISK / FTP upload methods you need to provide the webserver with write access rights to the configured upload path (configured in the project) and temporary upload path (used by PHP).
$g_max_file_size The maximum file size to allow as an attachment.
You may also have to configure your php.ini file to increase the execution time, memory limit, max post size, and max upload size.
$g_file_upload_ftp_server Address of the FTP server to write to (eg: ftp.example.com). This option is only effective if upload method is FTP.
$g_file_upload_ftp_user FTP user name for account to be used in uploading files to the FTP server. This account must have read/write access to the FTP server. The default path for the account is used for uploading the files.
$g_file_upload_ftp_pass Password to use when loggin in to the FTP server.
$g_max_file_size Maximum file size that can be uploaded. Default value is about 5MB.
The max file upload size is also affected by the value specified in php.ini. The PHP value is usually defaulted to 2MB.
$g_allowed_files Files that are allowed. Separate items by commas. eg. "zip,bmp,gif,jpg,txt" If $g_allowed_files is filled in NO other file types will be allowed. If empty it will assume any files are accepted that pass the $g_disallowed_files list.
$g_disallowed_files Files that are not allowed. Separate items by commas. eg. "php,php3,phtml,html,class,java,exe,pl" $g_disallowed_files takes precedence over $g_allowed_files.
It is recommended to disable all extensions that can be executed by your server.
$g_document_files_prefix Prefix to give to uploaded files when saved to the upload directory. This is used for documents that are attached to projects in order to be able to differentiate them from files that are attached to bugs. The name of the file has the following format prefix-projectcode-filename. The default value is 'doc'.
$g_preview_attachments_inline_max_size This feature applies to bmp, jpg, gif, and png files that are attached to bugs. If the file size is smaller than the specified values, the actual image is also previewed with the bugs. This feature can be disabled by setting the max size to 0. The default value is 0.

User Contributed Notes
File Upload
Add Notes About Notes
jp@PasDePourrielftz.fr
31-Oct-2003 1:28
#17
There are several place to define the maximum file size that can be uploaded :

In Mantis configuration file: config_defaults_inc.php or config_inc.php
$g_allow_file_upload = ON;
$g_max_file_size = 2000000; # 2 MB
$g_file_upload_method = DATABASE;

In the PHP configuration file : /etc/php.ini
upload_max_filesize = 2M

In the php Apache module : /etc/httpd/conf.d/php.conf The variable is LimitRequestBody (default to 512kB)
<Files *.php>
SetOutputFilter PHP
SetInputFilter PHP
LimitRequestBody 2097152
</Files>

If the update method is DATABASE, MySQL can also limit the file size
In /etc/my.cnf the variable max_allowed_packet must be defined.
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
set-variable = max_allowed_packet=5000000
stephan.grund@isst.fraunhofer.de
19-Jan-2004 3:02
#51
When changing from upload_method DATABASE to DISK for an existing database, is there a simple method to extract the existings files from the database?
Add Notes About Notes
Last updated: Wed, 08 May 2013 - 9:41:18

Mantis @ SourceForge