function hook_file_delete

hook_file_delete($file)

Respond to a file being deleted.

Parameters

$file: The file that has just been deleted.

See also

file_delete()

Related topics

File

modules/system/system.api.php, line 2968
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();
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!system!system.api.php/function/hook_file_delete/7.x