Mantis 2.0 Attachments not Downloading

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
sirbanks
Posts: 42
Joined: 05 Nov 2008, 15:14

Mantis 2.0 Attachments not Downloading

Post by sirbanks »

I've upgraded from 1.3.0 to 2.0.0. Barring a few hiccups, it went smoothly (had some issues with g_crypto) and everything seems to work except for attachment download. When you view an issue with an attachment, the link is clearly visible in the "Activities" section, and when you click the link a download is initiated in the browser. After a few seconds it appears the download is complete, however the downloaded file is empty (0K size). I have read through the forums but have not been able to find a solution. A couple things I tried based on some similar issues reported:

1. I added the 'g_absolute_path_default_upload_folder' path in the 'config_defaults_inc.php' page. I did not think we were supposed to directly edit this page, but it is the only place I could find this reference. No change was seen.
2. I found a reference check to 'enable_project_documentation' in the file_download.php file where it was checking to see if it was OFF. Again, this was in the config_defaults_inc.php page so I enabled it (set to ON), but it made no difference.

I have also checked the permissions on both the uploads folder and the uploaded files themselves. All appear OK, meaning that the file permissions are the same as on the 1.3.0 version file permissions. Has anyone experienced this problem with Mantis 2.0? Any help is appreciated. We are testing it now hoping to go live next week and this is the only issue we've found so far. 2.0 looks amazing and everyone testing it is very excited to switch!

Thanks in advance.
sirbanks
Posts: 42
Joined: 05 Nov 2008, 15:14

Re: Mantis 2.0 Attachments not Downloading

Post by sirbanks »

Sorry to answer my own post, but maybe it will be of benefit to anyone upgrading that runs into this problem. When I upgraded I had to use the new config_defaults_inc.php file (the one from my 1.3.0 installation would not work) and I had missed changing the default setting of $g_file_upload_method from DATABASE to DISK. I store all uploads to a disk directory since some are quite large. I hope this helps someone else out!
atrol
Site Admin
Posts: 8366
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Mantis 2.0 Attachments not Downloading

Post by atrol »

Never ever change the original config_defaults_inc.php!
All configuration should be done in config_inc.php.
Please use Search before posting and read the Manual
sirbanks
Posts: 42
Joined: 05 Nov 2008, 15:14

Re: Mantis 2.0 Attachments not Downloading

Post by sirbanks »

Yeah that is what I was thinking, but I am apparently doing something wrong. When I modify the config_inc.php file in the /config folder, the changes do not have an effect. An example is the crypto key: it would not work until I added it to the config_defaults_inc.php file. Any direction that would help correct this is appreciated!
atrol
Site Admin
Posts: 8366
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Mantis 2.0 Attachments not Downloading

Post by atrol »

Add the following line to config_inc.php

Code: Select all

die ("Hello from config");
After that, open any MantisBT page in your browser.
You should see nothing more than a page that displays "Hello from config".
You changed the wrong config_inc.php if you get the "normal" MantisBT page.
Double check, that you are in the right folder and there is no typo in the name of the file.
Please use Search before posting and read the Manual
sirbanks
Posts: 42
Joined: 05 Nov 2008, 15:14

Re: Mantis 2.0 Attachments not Downloading

Post by sirbanks »

No, I saw it. The page displayed "Hello from config".
atrol
Site Admin
Posts: 8366
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Mantis 2.0 Attachments not Downloading

Post by atrol »

I have no idea how it could be possible that you are able to fix an issue by changing a setting in config_defaults_inc.php, but changing the same setting in config_inc.php does not fix the issue.
Please use Search before posting and read the Manual
sirbanks
Posts: 42
Joined: 05 Nov 2008, 15:14

Re: Mantis 2.0 Attachments not Downloading

Post by sirbanks »

Nor do I. I tried it again by removing the crypto from the config_defaults_inc.php file and leaving it in the config_inc.php file located in the /config directory, but it error's out.
atrol
Site Admin
Posts: 8366
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Mantis 2.0 Attachments not Downloading

Post by atrol »

sirbanks wrote:I tried it again by removing the crypto from the config_defaults_inc.php file and leaving it in the config_inc.php file
Are you complete sure that there was no typo in the option name $g_crypto_master_salt?
Please use Search before posting and read the Manual
sirbanks
Posts: 42
Joined: 05 Nov 2008, 15:14

Re: Mantis 2.0 Attachments not Downloading

Post by sirbanks »

Absolutely. Just checked it again, but it was a 'copy/paste' procedure between the two documents.
atrol
Site Admin
Posts: 8366
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Mantis 2.0 Attachments not Downloading

Post by atrol »

Very strange.

This is the code we are talking about

Code: Select all

# Include default configuration settings
require_once( dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'config_defaults_inc.php' );

# Load user-defined constants (if required)
if( file_exists( $g_config_path . 'custom_constants_inc.php' ) ) {
	require_once( $g_config_path . 'custom_constants_inc.php' );
}

# config_inc may not be present if this is a new install
$t_config_inc_found = file_exists( $g_config_path . 'config_inc.php' );

if( $t_config_inc_found ) {
	require_once( $g_config_path . 'config_inc.php' );
}
We read config_defaults_inc.php, after that custom_constants_inc.php if it exists (maybe true in your case, but doesn't matter) and after that config_inc.php if it exists (true in your case)

Could you please upload your config_inc.php? (don't forget to remove database password)
Please use Search before posting and read the Manual
Post Reply