3

I want to offer a file download to my users, and I was thinking of using temporary:// to store the data. But how temporary is it? When do files disappear from it? Of course, I want to avoid having the file not be present when my user goes to download it jsut after a form submission, and I also want it gone after a while. So when do they go?

7

Temporary files that are created with the managed file functions are deleted when they are older than six hours, and during cron tasks.

The description for the FILE_STATUS_PERMANENT reports the following text:

Temporary files older than DRUPAL_MAXIMUM_TEMP_FILE_AGE will be removed during cron runs, but permanent files will not be removed during the file garbage collection process.

The value of DRUPAL_MAXIMUM_TEMP_FILE_AGE is 21600 (seconds), which means six hours.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.