Does removing a generalization of FileDocument also delete the file?

0
Regarding an entity with "FileDocument" generalization, does deleting its generalization directly eliminate the file contents on the storage server? This behavior is necessary as we plan to move the files to Amazon S3 and retain only the references in the existing entity (in the form of a new attribute). If the file contents aren't deleted, we will be left with approximately 30,000 files remaining in the storage, which would become inaccessible.
asked
3 answers
0

In Local the answer is yes.

The generalized entity retains the objects that it got. Specialization FileDocument entries removed. In the filesystem - contents binary files are removed but the folders which may are created to organize files are kept.

answered
1

FYI, this is the response from Mendix Support:

 

Current Behavior: In Mendix Cloud, file contents are retained even after deleting references, due to the com.mendix.storage.PerformDeleteFromStorage setting being set to false. This allows for database restoration to an older version.

 

Planned Change: R&D aims to update this behavior by the end of the quarter, allowing for file deletion when no longer referenced in the active database or backups.

answered
0

Pedro,

When we needed to do something similar (remove file contents but retain the entity and associations) I created this microflow:

image.png

 

The Java action does this

image.png

Which replaces the existing file contents with a simple string.  We also added an attribute to our file document specialization which indicates that the file contents have been removed:

image.pngHope that gives you some ideas as you are working on this.

Mike

answered