0; }catch(e){ return true;//safety } } If anyone has a resolution to this sort of issue, please advise"> 0; }catch(e){ return true;//safety } } If anyone has a resolution to this sort of issue, please advise"> 0; }catch(e){ return true;//safety } } If anyone has a resolution to this sort of issue, please advise">
Orphaned FileDocument files in the Uploaded Files path - Mendix Forum

Orphaned FileDocument files in the Uploaded Files path

1

Hi

This question has been asked before but I cannot seem to find a resolution on the Mendix forum for this.

For an on premise server utilizing local file storage, the issue is that files get created in $PROJ/data/files and that in some situations the file gets created on disk with no System.FileDocument instance associated to that file. We are currently resorting to using some custom java to iterate and compare the file on disk’s name with the __UUID__ field, if it does not exist, we go on and delete the file on disk via java with detection something along these lines

 

function fileHasIMendixObject(p){
    try{
    	var UUID=p.path.substring(p.path.lastIndexOf(seperator)+1);
    	var count=com.mendix.core.Core.retrieveXPathQueryAggregate(
    	    root.getContext(),
    	    "COUNT(//System.FileDocument[__UUID__='"+UUID+"'])"
    	);
    	return count>0;
    }catch(e){
    	return true;//safety
    }
}

If anyone has a resolution to this sort of issue, please advise

asked
1 answers
1

You can also try to set com.mendix.core.localfilesystem.cleaning.isEnabled and tweak with com.mendix.core.localfilesystem.cleaning.time in the custom settings of your runtime. If this is solving your issue than please also file a ticket to check out why this still happens in your 7.23.6 version of your app (I assume according to the info in your question)

answered