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

rhysonline created an issue. See original summary.

rhysonline’s picture

Issue summary: View changes
muranod’s picture

I'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]