Re: Delete temporary images after loading website
- From: Andrea Scharfe <schmedi@xxxxxxxxx>
- Date: 30 Apr 2007 02:31:57 -0700
I do the image generation with an external programme (gnuplot), so the
images are not generated by PHP directly.
I now found the following solution, which seems to work quite well:
/* remove older images in folder temp */
$command = "ls ".$_CONFIG["tempdir"];
exec($command, $output, $retval);
$time = time();
foreach ($output as $file) {
if (($time-filemtime($_CONFIG["tempdir"]."/".$file))>300) {
unlink($_CONFIG["tempdir"]."/".$file);
}
}
Thanks for your comments!
Andrea
.
- References:
- Delete temporary images after loading website
- From: Andrea Scharfe
- Re: Delete temporary images after loading website
- From: Tyno Gendo
- Delete temporary images after loading website
- Prev by Date: Re: RegEx - Chk for special chars
- Next by Date: Re: Manipulating binary data
- Previous by thread: Re: Delete temporary images after loading website
- Next by thread: Database server auto-close
- Index(es):