Attachment Missing - MantisBT 2.17.1

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
PixelBoxes
Posts: 6
Joined: 12 Oct 2018, 19:39

Attachment Missing - MantisBT 2.17.1

Post by PixelBoxes »

Hello all,

I've been going around in circles on this one and I haven't been able to find an answer via reading message board posts and Google searches that has fixed my error. My apologies in advance if there was a simple fix that was listed and I didn't see it, I honestly have tried to fix this on my own for multiple hours. If more information is needed, please let me know and I will submit it ASAP.

System Specs
MantisBT version 2.17.1 on a fresh Hyper-V VM in Server 2012 R2 Standard in IIS 8.5.
2 virtual processors | 4GB of RAM
SQL Server 2016 as database software
PHP versions installed are v5.3 and v7.2 with v7.2 the one being utilized. PHP v5.3 was installed through the IIS Web Platform Installer when I initially began and then I installed v.7.2 manually.

The Problem
When an attachment is submitted either through a new ticket or as a note, the attachment always ends up listed as (bold part is listed with a strikethrough - attached example) "ATTACHMENT NAME.any (Attachment missing)".
The file does not appear in the designated folder for attachments and there are no errors that appear upon submittal.

What I've Verified / Checked So Far
1. Made sure it wasn't a file permission error as I tested by taking away write permissions for the account being utilized and received the error page after submitting.

2. Made sure that the file type is allowed in config_inc.php. Currently, I have it set to default for allowed files and only have EXE set under disallowed files.

3. Configured the following settings for file uploads.
Config_inc.php
$g_allow_file_upload = ON;
$g_absolute_path_default_upload_folder = 'c:\sites\MantisBT\attachments';
$g_dropzone_enabled = OFF;
$g_max_file_size = 5000000;
$g_file_upload_method = DISK;
$g_file_upload_max_num = 10;
$g_allowed_files = '';
$g_disallowed_files = 'exe';
$g_preview_attachments_inline_max_size = 512 * 2048;

php.ini
post_max_size = 8M
upload_max_filesize = 5M
memory_limit = 128M


Thank you in advance for any help!
-Greg
Attachments
Attachment Strikethrough Example
Attachment Strikethrough Example
Mantis Issue.PNG (8.96 KiB) Viewed 3056 times
atrol
Site Admin
Posts: 8366
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Attachment Missing - MantisBT 2.17.1

Post by atrol »

I can't check with Windows at the moment.
I assume this is wrong, as there is a missing trailing \

Code: Select all

$g_absolute_path_default_upload_folder = 'c:\sites\MantisBT\attachments';
Run admin/check/index.php where you might get this hint/warning and maybe some more
Please use Search before posting and read the Manual
PixelBoxes
Posts: 6
Joined: 12 Oct 2018, 19:39

Re: Attachment Missing - MantisBT 2.17.1

Post by PixelBoxes »

Thanks atrol for picking this up!

I verified that by adding the \ at the end to make the code as below, it broke the site completely until I removed it again.

Code: Select all

$g_absolute_path_default_upload_folder = 'c:\sites\MantisBT\attachments\';
Forgive my ignorance on this, but how would I perform this task you requested?
Run admin/check/index.php where you might get this hint/warning and maybe some more
atrol
Site Admin
Posts: 8366
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Attachment Missing - MantisBT 2.17.1

Post by atrol »

Try also

Code: Select all

$g_absolute_path_default_upload_folder = 'c:\sites\MantisBT\attachments\\';
Run admin/check/index.php means open http://www.YourDomain.com/yourMantis/ad ... /index.php in your browser.

I noticed you are using SQL-Server.
Sorry I can't provide help for this database, but maybe this is your problem https://mantisbt.org/bugs/view.php?id=9254
If so, you could try to set the path in settings of project page instead of setting it in config_inc.php

I recommend to use MySQL because it's the most used and best supported database for Mantis.
Please use Search before posting and read the Manual
PixelBoxes
Posts: 6
Joined: 12 Oct 2018, 19:39

Re: Attachment Missing - MantisBT 2.17.1

Post by PixelBoxes »

Ah, that worked! By changing the code to what you said below, the attachments work now!

Code: Select all

$g_absolute_path_default_upload_folder = 'c:\sites\MantisBT\attachments\\';
That was such an easy fix. I didn't realize I had a problem with the code itself!

I've also added the admin folder back to the root sites folder so I can access it once again via the URL you provided.

As for MySQL, there was a push to try and use Microsoft SQL since we primarily run that in house, so hopefully we won't run into any major issues there.


Thank you very much for your assistance and please feel free to mark this as resolved.

-Greg
Post Reply