Hi,

Is there a way to get the filefield path on during node submit (save process)?
I need to write a text file in the same directory as my files when I submit a node with file field and custom file path.

I was hoping to use hook_form_submit_handler($form, &$form_state) but $form_state['values'] does't include the custom path only private://files
Can I find the custom path during my submit handler? Where would you suggest writing the code to write a txt file (including submitted node field values) to same path as the files saved files?

Any help appreciated!

Comments

Deciphered’s picture

Status: Active » Fixed

The whole reason behind this module is that the entity tokens are not known until the entity is actually saved, and as such the file can not be moved into it's destination until after the the entity is saved.

File (Field) Paths is currently doing it's magic on hook_field_storage_pre_insert/update, so you could implement your own version of that hook, ensuring it runs after File (Field) Paths, and you will be able to get the information you are after.

Status: Fixed » Closed (fixed)

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