function hook_file_presave


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_presave($file)
cle7 system.api.php hook_file_presave($file)
elmsmedia7 system.api.php hook_file_presave($file)
icor7 system.api.php hook_file_presave($file)
meedjum_blog7 system.api.php hook_file_presave($file)
mooc7 system.api.php hook_file_presave($file)

Act on a file being inserted or updated.

This hook is called when a file has been added to the database. The hook doesn't distinguish between files created as a result of a copy or those created by an upload.


$file: The file that has just been created.

See also


Related topics

4 functions implement hook_file_presave()

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_presave in modules/simpletest/tests/entity_crud_hook_test.module
Implements hook_file_presave().
filefield_paths_file_presave in sites/all/modules/ulmus/filefield_paths/filefield_paths.module
Implements hook_file_presave().
file_entity_file_presave in sites/all/modules/ulmus/file_entity/
Implements hook_file_presave().
transliteration_file_presave in sites/all/modules/ulmus/transliteration/transliteration.module
Implements hook_file_presave().
1 invocation of hook_file_presave()
file_save in includes/
Saves a file object to the database.


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


function hook_file_presave($file) {
  // Change the file timestamp to an hour prior.
  $file->timestamp -= 3600;