Upload in different directories

I am in the case of a multi-company and I am looking to have one directory per company.


I thought of creating a directory each time a company is created with a java method but the upload will always be based on the variable file.upload.dir

How can I do this?

it’s not liked that, one directory is used and above is virtual. DMS module manage it. However you can create folders based on your requirements

It is possible to manage several connections: https://docs.axelor.com/adk/5.4/dev-guide/application/multi-tenancy.html

It is not possible to set the registration directory for each tenant ?

yes, unfortunately, multi tenancy is feature provided by hibernate not by axelor.

1 « J'aime »

In multi-tenancy mode, files are uploaded inside sub directories per tenant.

Hi Siddique,
Thank you for your support of this community.

Just to let everyone know, this approach, of storing file data on disk and not in the database can potentially cause serious data loss if the default setting for the DMS dir is left unchanged in your properties file. Files should be saved in the database as BLOBs, not separately, on disk.

This is a major bug, and a major design flaw in Axelor. All data should be stored in the database. Modern databases should have no trouble with this. The Tomcat tmp dir should not be used in this way. Even if you can reconfigure the path, and point it to a properly persisted data store, it is still possible for the disk and the database to get out of sync, and if you think you’re safe because you’ve backed up your database, but forgotten to back up the disk, you could be in real trouble.

Axelor, please fix this urgently, and store all data in the database from now on. In the interim, please add a big warning in the application.properties file about this.

1 « J'aime »

This is not design flaw, it’s design choice, we need to make understand how any system works.

Rest it needs to be added in documentation

1 « J'aime »