Skip navigation
Help

hook_file_delete

7 system.api.php 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

5 functions implement hook_file_delete()

1 invocation of hook_file_delete()

File

drupal/modules/system/system.api.php, line 2669
Hooks provided by Drupal core and the System module.

Code

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