View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0004627||mantisbt||feature||public||2004-09-28 10:48||2012-09-30 06:42|
|Status||closed||Resolution||no change required|
|Summary||0004627: 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.
|Tags||No tags attached.|
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
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.
However you can use releative path name like '....\mydocs\'.
edited on: 10-19-04 09:05
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.
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.
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.
Since Mantis 1.2, an absolute path for attachments can be specified, so I guess this is obsolete.