File Upload

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: PHP Manual .

Mantis FAQ

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