2

Here is my case:

When a user is creating a new account, he can upload a profile picture that is stored in a temporary folder. When the user finishes creating the account, the picture is stored in the normal folder and removed from the temporary folder.

The problem is when the user upload the picture and doesn't continue with the account creation. The picture will be stay in the temporary folder.

I stored those files in the Linux temporary folder. Is it that correct? If so, will they be automatically remove? Any other better solution? I'm using CakePhp

Regards

Pilar
  • 43
  • 4
  • A similar question as been asked before: [deleting old files using crontab](http://stackoverflow.com/questions/5375409/deleting-old-files-using-crontab) – Pádraig Galvin May 10 '13 at 14:23

2 Answers2

1

Depending on the OS the /tmp directory is usually only emptied on reboots

If you mean the CakePHP tmp directory. I don't think there is anything that specifically cleans up non-framework files from it so you may have to write something yourself

fullybaked
  • 4,117
  • 1
  • 24
  • 37
-1

Every time a user tries to register scan the tmp images dir and remove images older than 24h for example

Alex Barroso
  • 839
  • 6
  • 14