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/api.elmsln.org/includes/bootstrap.inc).
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.

Parameters

$file: The file that has just been deleted.

See also

file_delete()

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/file_entity.file.inc
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/file.inc
Deletes a file and its database record.
file_delete_multiple in sites/all/modules/ulmus/file_entity/file_entity.file_api.inc
Delete multiple files.

File

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

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.