hook_file_delete

  1. drupal
    1. 8
    2. 7
Versions
7 – 8 hook_file_delete($file)

Respond to a file being deleted.

Parameters

$file The file that has just been deleted.

See also

file_delete()

upload_file_delete()

Related topics

Code

modules/system/system.api.php, line 2702

<?php
function hook_file_delete($file) {
  // Delete all information associated with the file.
  db_delete('upload')->condition('fid', $file->fid)->execute();
}
?>