0

My use case is that I want to set an uploaded file as FILE_STATUS_PERMANENT until I know it has been processed correctly by my custom module. Once that is done, I'm happy for Drupal to delete it. There used to be a FILE_STATUS_TEMPORARY in D6 but no more. What should I use?

0

That is strange, as FILE_STATUS_PERMANENT still does exist indeed. But the value of FILE_STATUS_TEMPORARY used to be 0. So I suppose you can use anything that evaluates to zero: FALSE, NULL, 0. Personally I have always used 0.

But why set your file back to temporary to have it deleted by cron, why not just delete the file directly after processing? You can use file_delete() to do that.

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.