Demo Discussion
Forum Config Examples Contributions Vulnerabilities
  Discussion forum about ELOG  Not logged in ELOG logo
icon5.gif   Cleaning up attachments, posted by Louis de Leseleuc on Tue Mar 15 21:38:01 2011 
    icon2.gif   Re: Cleaning up attachments, posted by Stefan Ritt on Fri Mar 18 11:07:50 2011 
       icon2.gif   Re: Cleaning up attachments, posted by Louis de Leseleuc on Mon Mar 21 17:42:15 2011 
Message ID: 67028     Entry time: Fri Mar 18 11:07:50 2011     In reply to: 67027     Reply to this: 67031
Icon: Reply  Author: Stefan Ritt  Author Email: stefan.ritt@psi.ch 
Category: Bug report  OS: Linux  ELOG Version: 2.9.0 
Subject: Re: Cleaning up attachments 

Louis de Leseleuc wrote:

I noticed a behavior that might be irritating. 

After attaching/uploading files to an entry and before submitting it, one might press 'Back' or close the browser window.

This in effect cancels the entry and sends into oblivion. HOWEVER the attachments and their thumbnail files remain on the server forever.

Would there be a way to either delete attachments after some time if they don't show up in an entry? Or some other magic trick with the browser? My logbook directories are already full of orphan files that I need to seek and destroy.

Also, any thoughts on automatically cleaning up a logbook directory when the damage is done?

Louis

Well, this is not so easy. When you leave the browser (via 'Back' or just by closing), it has no way to communicate with the elog server. I could put in some JavaScript, but if people switch off JavaScript there is no way. On the other hand it might be simple to write just a little shell script, which goes through all files on the server and checks if the file name occurs in some elog entry. This can probably be done with some combination of "find" and  "grep", but I'm not a shell script expert.

ELOG V3.1.5-fe60aaf