Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
After changing or delete a file ($delete_original = TRUE), its status = 0 (in the table files), but the file is not deleted
Comments
Comment #1
Alan D. CreditAttribution: Alan D. commentedCRON must be enabled!
All file deletion is done via
system_cron()
. Once flagged as temporary, the files will hang around for about 6 hours, after that time, the cron process deletes the file.Comment #2
ipto CreditAttribution: ipto commentedThank you, I will try this solution
Comment #3
Alan D. CreditAttribution: Alan D. commentedThinking about this a bit more, I'll do a proper delete in the save handler, which will make the save logic a bit cleaner, especially when the new file is going to replace the existing file with the same name.
Cron still needs to be enabled to clean up any temp files though. Each time a file is uploaded via the AHAH request, a temp file is created. This is only cleaned up by cron, and this part will not change.
Comment #4
ipto CreditAttribution: ipto commentedWonderful, thank you. Creating issue, I mean those files that were once used (those that are no longer in the tmp directory).
Comment #5
Alan D. CreditAttribution: Alan D. commentedChanges committed, so another dev version will be out tonight/tomorrow with the changes.
Comment #6
ipto CreditAttribution: ipto commentedI tested it today, is doing fine, thank you