In Mendix, uploaded files (anything inheriting from System.FileDocument) are not stored in the database. The DB only keeps metadata (name, size, content-type, ID etc). Actual file is stored at path which can be configurable.
If deployed locally, files can be found in the deployment directory of your project under data/files. If deployed to Mendix Cloud, files are stored in managed file storage (backed by Amazon S3) automatically.
You can change the file location; for Local (Studio Pro / running from IDE):
Project > Settings > Configurations > Server > Extra Runtime Settings. Then add the following:
UploadedFilesPath = C:\MendixFiles
For on prem windows server add the same config to: Service Console > Advanced > Custom Runtime Settings
Hi Rishi,
All the Mendix objects declared as a specialization of "System.FileDocument" are stored as files/blob objects. In local it will be in the deployment folder, in cloud, it will be a part of Volume storage.
If your query is about deleting the files, the only "graceful" way to delete is within the Mendix application. This is because each file has a reference name which has to be correctly maintained between System.FileDocument and the file blob tree strucuture.
Case 1 : When you delete the file in the /deployment directory, that becomes a missing reference in the System.FileDocument table. This can be a case of missing file object.
Case 2 : When restore "only DB" from some other env., the are some invalid references which are part of the System.FileDocument table which do not exist in the env. (cloud be /deployment folder or a volume storage if its a cloud env.)
Your possibility 2 is not a good way to store file in the database. It can cause performance issue in the database.
So the only way to manage it is to design correct lifecycle of a file within the Mendix application so that references remain valid and the database remains with valid file references
https://docs.mendix.com/developerportal/operate/restore-backup/#tree-folder