0

Possible Duplicate:
php:: how long to tmp files stay?

After uploading file on server, his location is tmp folder right?

My question is: If We dont removing file from tmp folder, how long time will this file in tmp folder? As I know server automatically removes all files from tmp folder, right?

Community
  • 1
  • 1
ANOTHER
  • 123
  • 2
  • 5

2 Answers2

1

After uploading file on server, his location is tmp folder right?

Not necessarily; Apache does not itself save uploaded content anywhere.

If you are using PHP, uploaded files are removed from the upload temporary directory immediately when the request is completed.

  • `Not necessarily; Apache does not itself save uploaded content anywhere.` But, before we copyng file using function `move_uploaded_file()`, file location, as default is tmp folder, right? – ANOTHER Nov 29 '12 at 16:50
  • 1
    PHP is what puts the file there, not Apache. –  Nov 29 '12 at 17:29
1

Answer is depends by your configuration. If you set a custom temporary folder for uploaded files in php.ini or in your application, it won't automatically removed by system. By default, php uses /tmp directory for temporary files. It's not related with apache.

On a linux system /tmp (or /var/tmp) is designed to use with files which are created, edited and deleted in a short period of time.

If you don't remove your files in /tmp, your server would automatically remove many of them (or all) on next system reboot.

edigu
  • 9,878
  • 5
  • 57
  • 80