| Versions | |
|---|---|
| 7 | 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.
drupal/
<?php
function hook_file_presave($file) {
// Change the file timestamp to an hour prior.
$file->timestamp -= 3600;
}
?>