Link to home
Start Free TrialLog in
Avatar of Julian Matz
Julian MatzFlag for Ireland

asked on

PHP TMP Directory

Hi! I was wondering how temporary files are handled when uploaded in php... Uploaded files are initially stored in the tmp directory - do they get automatically deleted or does it have to be done manually ? Is it done by php, do I have to write a script or is it done by the server periodically, e.g. Cron ?
Avatar of TeRReF
TeRReF
Flag of Netherlands image

You use move_uploaded_file() for this purpose:
http://php.net/manual/en/function.move-uploaded-file.php
Avatar of Julian Matz

ASKER

Hi TeRReF,

Yes, I know about that function, but I was thinking about files that maybe fail to get moved, etc.
Does that make sense ? Session data gets stored there too, doesn't it ?

Just looked into the server's tmp directory - there's a lot of session data but only very recent... But there are also some files there that are a couple of months old - one of them seems to be an image:

Oct 15 01:45 phpaMbFwY.jpg
ASKER CERTIFIED SOLUTION
Avatar of TeRReF
TeRReF
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks!
You're welcome :)