function hook_file_delete


Error message

User warning: The following module is missing from the file system: theme/theme. For information about how to fix this, see the documentation page. in _drupal_trigger_error_with_delayed_logging() (line 1156 of /var/www/html/elmsln_community/
cis7 system.api.php hook_file_delete($file)
cle7 system.api.php hook_file_delete($file)
elmsmedia7 system.api.php hook_file_delete($file)
icor7 system.api.php hook_file_delete($file)
meedjum_blog7 system.api.php hook_file_delete($file)
mooc7 system.api.php hook_file_delete($file)

Respond to a file being deleted.


$file: The file that has just been deleted.

See also


Related topics

9 functions implement hook_file_delete()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

entity_crud_hook_test_file_delete in modules/simpletest/tests/entity_crud_hook_test.module
Implements hook_file_delete().
file_entity_file_delete in sites/all/modules/ulmus/file_entity/
Implements hook_file_delete().
file_file_delete in modules/file/file.module
Implements hook_file_delete().
file_test_file_delete in modules/simpletest/tests/file_test.module
Implements hook_file_delete().
imagefield_focus_file_delete in sites/all/modules/ulmus/imagefield_focus/imagefield_focus.module
Implementation of hook_file_delete().

... See full list

2 invocations of hook_file_delete()
file_delete in includes/
Deletes a file and its database record.
file_delete_multiple in sites/all/modules/ulmus/file_entity/
Delete multiple files.


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


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



Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/ in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/
The website encountered an unexpected error. Please try again later.