Page 1 of 1

Attachments not working - Error 500

Posted: 28 Feb 2020, 08:57
by RLight1
When users are adding attachments to their posts they are met with "HTTP ERROR 500" Server unable to handle this request.
I have set up a directory in the root of C: and entered this into the "Upload file path" under "Edit project" the file path is as follows C:\temp\
I can see files in this directory see attachment "tempupload"

My config_inc.php section for the attachments is as the following

--- Attachments / File Uploads ---
$g_allow_file_upload = ON;
$g_file_upload_method = DISK;
$g_absolute_path_default_upload_folder = 'C:\temp\'; # used with DISK, must contain trailing \ or /.
$g_max_file_size = 5000000; # in bytes
$g_preview_attachments_inline_max_size = 256 * 1024;
$g_allowed_files = 'jpg,txt,png'; # extensions comma separated, e.g. 'php,html,java,exe,pl'
$g_disallowed_files = ''; # extensions comma separated
(Note that "$g_absolute_path_default_upload_folder" is disabled in the above. If I enable it then I am no longer able to access the site)

See attachment "Check" For http://127.0.0.1:81/mantis/admin/check/index.php results

I am now stuck on how to get the attachments working and hope someone can see the fault. Please let me know if you require any further information from me.

Re: Attachments not working - Error 500

Posted: 07 May 2020, 16:03
by Sprezzatura
I got it to work based on another post:

(from viewtopic.php?f=2&t=26088&p=67360&hilit ... 500#p67360)

Run:

http://<yourMantisUrl>/admin/check/index.php

If the error is:

Code: Select all

Fileinfo PHP extension is available to support file uploads
Ensure that the fileinfo extension is installed and enabled
Edit php.ini and uncomment this line:

extension=php_fileinfo.dll

(See https://www.php.net/manual/en/fileinfo.installation.php)