Hi all,

In mp_file_commit function, it would be useful to add the new filename and the new filepath of the file after renaming and copying it:

<?php
function mp_file_commit($node, $file_path, $description, $title, $fid) {

[...]

  // Finally, copy the file to a more secure directory
  copy($file_path, $dir . $new_name);

  // Update node for further reuse
  $node->new_filename = $new_name;
  $node->new_filepath = $dir . $new_name;

[...]

}
?>

At least, it is useful to me...

Best regards.s
K.

Comments

syndicateStorm’s picture

See the latest 6.x dev release. Specifically hook_mpf_new_file_name allows you to manipulate the file names before they are copied. You state you would like to add this information "after", but I'm assuming that "before" would work fine for you?

Let me know if/how this works for you.

syndicateStorm’s picture

Status: Active » Fixed

mp_file has changed significantly. If you are having a similar problem with the latest dev release, post it as a new issue.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.