Upload Files to Disk
Moderators: Developer, Contributor
Upload Files to Disk
Hello
I am trying to make Mantis upload files to disk instead of database, so I used this configuration in the config_inc file
$g_file_upload_method = DISK;
but I get this error whenever I try to upload a file
APPLICATION ERROR #503
Invalid upload path. Directory either does not exist or not writable to webserver.
I am not sure if should configure a path for uploads or there is a default path and where to find it.
Please help...
I am trying to make Mantis upload files to disk instead of database, so I used this configuration in the config_inc file
$g_file_upload_method = DISK;
but I get this error whenever I try to upload a file
APPLICATION ERROR #503
Invalid upload path. Directory either does not exist or not writable to webserver.
I am not sure if should configure a path for uploads or there is a default path and where to find it.
Please help...
Re: Upload Files to Disk
There is a global setting, but I recommend this way:
Goto page Manage > Manage Projects
Click on a project name
Change field "Upload File Path"
Repeat steps for each of your projects.
Goto page Manage > Manage Projects
Click on a project name
Change field "Upload File Path"
Repeat steps for each of your projects.
Re: Upload Files to Disk
I created a folder named "files" inside my mantis folder deployed in apache on windows (XAMPP) and gave "Everyone" full permissions then filled the suggested field with the following value "\files\"atrol wrote:There is a global setting, but I recommend this way:
Goto page Manage > Manage Projects
Click on a project name
Change field "Upload File Path"
Repeat steps for each of your projects.
But when i tried to update the project i received the same error
APPLICATION ERROR #503
Invalid upload path. Directory either does not exist or not writable to webserver.
Re: Upload Files to Disk
Thank you, adding absolute path solved the issue e.g. "c:\files"
I strongly recommend adding it to documentation to help others configuring their servers
Thanks again
I strongly recommend adding it to documentation to help others configuring their servers
Thanks again
-
- Posts: 122
- Joined: 09 Mar 2016, 21:44
Re: Upload Files to Disk
Hello,atrol wrote:There is a global setting, but I recommend this way:
Goto page Manage > Manage Projects
Click on a project name
Change field "Upload File Path"
Repeat steps for each of your projects.
I was searching for the same thing. We are using Mantis 1.2.19 but in the Manage > Manage Projects > project name i could not see the field "Upload File Path"
Any help please ?
Re: Upload Files to Disk
@NandoNaldo, maybe you have not set
Keep in mind that after setting $g_file_upload_method = DISK; you will not able able to read existing attachments which are stored in database.
Those old attachments have to be migrated to file system.
Code: Select all
$g_file_upload_method = DISK;
Those old attachments have to be migrated to file system.
-
- Posts: 122
- Joined: 09 Mar 2016, 21:44
Re: Upload Files to Disk
Yes, you are right. The follwing config of my Mantis:
# --- Attachments / File Uploads ---
$g_allow_file_upload = ON;
# $g_file_upload_method = DATABASE; # or DISK
# $g_absolute_path_default_upload_folder = ''; # used with DISK, must contain trailing \ or /.
Question:
- I should migrate manually all the files manually?
- after changing $g_file_upload_method = DISK;, the DISK can be a file server ?
# --- Attachments / File Uploads ---
$g_allow_file_upload = ON;
# $g_file_upload_method = DATABASE; # or DISK
# $g_absolute_path_default_upload_folder = ''; # used with DISK, must contain trailing \ or /.
Question:
- I should migrate manually all the files manually?
- after changing $g_file_upload_method = DISK;, the DISK can be a file server ?
Re: Upload Files to Disk
I can't recommend to change to DISK using version 1.2.19 as there is this bug between versions 1.2.16 and 1.2.19 https://www.mantisbt.org/bugs/view.php?id=20340
So you should at least upgrade to 1.2.20 or even better to latest 1.3 or latest 2.0
After that
Run ../admin/system_utils.php to get an impression (you might have to restore directory admin as you have been told to remove it after installation)
So you should at least upgrade to 1.2.20 or even better to latest 1.3 or latest 2.0
After that
No, there is a tool coming with Mantis to do the job.NandoNaldo wrote: - I should migrate manually all the files manually?
Run ../admin/system_utils.php to get an impression (you might have to restore directory admin as you have been told to remove it after installation)
It must be a directory where your webserver has rights to create files. It can be on your local file system or on a file server.NandoNaldo wrote: - after changing $g_file_upload_method = DISK;, the DISK can be a file server ?
-
- Posts: 122
- Joined: 09 Mar 2016, 21:44
Re: Upload Files to Disk
Thank You for your help. As i understand better the version less problems
Till now i was trying to avoid an upgrade to 2.4.0 or 2.4.1 because i'm afraid of losssing date and i am not sure if the tables of issue, projects, bug and all of that are compatible beetwen versions.
I don't know if upgrading to a higher version will cause lose of data ?
Thnx
Till now i was trying to avoid an upgrade to 2.4.0 or 2.4.1 because i'm afraid of losssing date and i am not sure if the tables of issue, projects, bug and all of that are compatible beetwen versions.
I don't know if upgrading to a higher version will cause lose of data ?
Thnx
Re: Upload Files to Disk
Upgrade should not loose any data, that's why it's highly recommended to create a backup of your database before upgrading.NandoNaldo wrote:I don't know if upgrading to a higher version will cause lose of data ?
In case you plan to upgrade to 2.x, first ensure that your server meets the requirements https://www.mantisbt.org/docs/master/en ... e.versions