Changing the file of a file field (drupal 7)
File fields are referenced by their ID in the file_managed table; as well as updating the field in your presave hook, you'll probably need to update the file entity that relates to that id with the new filename/path.

This is just a basic example but it should give you a starting point:

// Get the file id from the field
$fid = $node-&gt;field_file[$node-&gt;language][0]['fid'];

// Load the file
$file = file_load($fid);

// Update the filename
$file-&gt;filename = basename($new_path);

// Update the uri (this must be in the format of a schema uri, e.g. public://folder/file.jpg
$file-&gt;uri = $new_path;

// Save the changes
file_save($file);


You might also want to update the filesize field; it's used in a few places in the system.