Welcome Guest, Not a member yet? Register   Sign In
[?] Deleting user created resources after user leaves site
#1

[eluser]carvingCode[/eluser]
In the app I'm currently working on, I use 'jpgraph' to create graphs. Works great - highly recommended.

In this particular application, users set up searches by varying criteria and graphs are created using that criteria. So there will be many different graph files created.

Problem: What's the best way to handle deleting images after a user is no longer on the site? Users do not create accounts on this site. Is it a matter of setting up a cron job to run at a particular time? Or is there a way to do this using sessions?

TIA

Randy
#2

[eluser]WanWizard[/eluser]
I run a cronjob at regular intervals that deletes all files older than x based on creation timestamp of the file.

Make sure your application can deal with file-not-found situations in case the user browses back or uses a bookmarked link with an expired graph.
#3

[eluser]carvingCode[/eluser]
Thanks, Wizard.




Theme © iAndrew 2016 - Forum software by © MyBB