View Issue Details

IDProjectCategoryView StatusLast Update
0004627mantisbtfeaturepublic2012-09-30 06:42
Reporterkgrubbs Assigned Todregad  
Status closedResolutionno change required 
Product Version0.19.0 
Summary0004627: More flexible DISK configurations

As far as I know right now you can only write attachments to a subdirectory of the mantis installation. It would be nice if this could be configured so that the base directory for uploads could be configured in the config file. For instance, it would be nice to be able to write to another directory on the drive or even a network drive.

If you did this, then it would be possible to have two servers running the frontend application to ease the load. If this sounds feasible and doesnt have security implications, I will sponsor this issue.

TagsNo tags attached.




2004-09-28 11:39

reporter   ~0007809

Last edited: 2004-09-28 13:26

FWIW, I have my file data stored outside the mantis tree. I have a private RH8.0 Linux machine where I control everything, so your mileage may vary.

I added a directory /var/mantis with owner apache:apache (corresponding to the web server). You need root access to do this. The mantis application can write it's files in this directory. For each project, I define /var/mantis or /var/mantis/<project name> as the Upload File Path.

An improvement would be to have a globally specified base path for this.

edited on: 09-28-04 13:26



2004-09-28 12:38

reporter   ~0007812

Thanks thrax. Sounds like a great idea... but unfortunately the mantis installation is running on a windows box. So if anyone has any ideas on a workaround for windows, I'd love to hear it. Also for those running on a shared linux installation, like you said, wouldnt have this capability either. So yeah... a fix for this would be most excellent.

I tested a couple things, so maybe I didnt get it right... the documentation isnt too clear on this field. But when I tried to set the Upload file path to "E:\mantis_uploads\", I think the app tried to treat this as "C:\Inetpub\wwwroot\mantis\E:\mantis_uploads\". At least this is how the system utility for pulling files out of the database on to disk treated it.



2004-10-11 01:59

reporter   ~0007979

Last edited: 2004-10-19 09:05

However you can use releative path name like '....\mydocs\'.

edited on: 10-19-04 09:05



2004-10-11 08:16

reporter   ~0007981

Ok yes, I realize this. I've done a little more looking into this, and apparently you CAN put full paths to another drive and/or directory. I think the bug with this is in the system utility that moves files from DB to Disk... it was giving me errors when I tried to put a full path with drive letter.

However, if you put the full path, then that full path is stored in the database, which makes it a little hard to move files around later if you need to. I know it sounds like a fluffy request... but I can see it happening.

I think a global variable that indicates where the starting point for files should be if the project setting for files is not a valid system path. Soemthing like this:

1) If the project upload path is set and it is a valid directory, use it.
2) If the project upload path is set and it is not a valid directory, try to see if adding the global upload path to the beginning of that makes it a valid path.
3) Otherwise, write into the mantis directory with the path specified in the project upload path.



2005-08-01 23:00

reporter   ~0011052

I found that relative paths up out of the mantis install worked fine, so I put a directory nearby that wasn't visible to the outside world, and had all my projects place their attachments in subdirectories of that. Works pretty well.



2007-10-04 23:01

reporter   ~0015809

I have tried to use DISK save mode but had the problem of incorrect path setting. Finally I found the problem is caused by project field result. Seems when retrieve field of project path, the return will be a space not a empty string. So prevent the system from retrieving config on "$g_absolute_path_default_upload_folder". To make it work, you will need to modify the code in "file_api.php".

Change the line:

$t_file_path = project_get_field( $t_project_id, 'file_path' );


$t_file_path = trim( project_get_field( $t_project_id, 'file_path' ));

Then everything will work just fine.



2012-09-19 11:16

developer   ~0032885

Since Mantis 1.2, an absolute path for attachments can be specified, so I guess this is obsolete.