How to Delete files from Application Server along with Database

0
Hi Team,   Could you please let me know how I can delete the files from Application server folder as it is occupying more space than Database server. If i manually delete the files from Application folder, the files reference still remains in Application and database.   If i try to delete from microflow by using retrieve option of system.file documents from Database. The files are getting deleted from Database but still exists in Application and Application Server Folder.   Please suggest here how can i proceed further with the deletion of Files from the Application server .   Regards, Shabana
asked
2 answers
0

Hi Shaik,

 

The correct approach for files created in the Mendix application would be to retrieve the files in a microflow and delete them in that microflow. Mendix handles the data consistency between the database reference for that file and the file on the file-system. It will remove from both (database record and file system) once the microflow completes. If you delete files in another way you might get orphaned files or database references to files that no longer exist.

 

If this doesn't solve your question can you please elaborate on where you find these files and how they were added to the application?

 

With kind regards, Stephan

answered
0

Hi,

 

For example:

Record in Database:

image.png

 

Record in Application server folder

image.png

 

Microflow :

 I have tried to retrieve from File document entity after that i have used delete activity.

image.png

In this microflow am passing the fileID.

But after Deleting the files gets removed from Database but remains in Application folder.

 

Regards,

Shabana

 

answered