Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I'm sure I am missing something really obvious. I am uploading files (jpg, pdf, xls) in a webform (7.x-4.24) and need to append the node NID to the original filename. But I can't seem to find a token for the name of the uploaded file.
I tried these which successfully fetch the nid but they don't fetch the filename: [node:nid]-[file:original:ffp-name-only-original] and [node:nid]-[file_field:filename]
Thanks for the help.
Comments
Comment #2
rhysonline CreditAttribution: rhysonline commentedComment #3
muranod CreditAttribution: muranod commentedI'm having the same difficulty getting a file name to be added to the form. The form field for filename is always blank. The image goes into the temp folder with the original filename.
Copying and pasting the original filename into the form field works, but a _0 is appended to the filename.
If I type in a file name without an extension it appears in the Media Library with that new name and no file extension and is routed into the desired folder with the original filename.
I can then pull that image into a media/image field where it works normally. It also is working when I pull images into a view.
I think I can work with this, but since this is a photography site, I want to make sure I'm not potentially creating major headaches down the road by proceeding this way.
Some of the tokens I've tried in the media name field:
[media:name:value]
[media:field_media_document:entity:original]
[media:name:value].[file.ffp-extension-original]
[file:ffp-name-only].[file:ffp-extension-original]