Is there a way to use a token like [file:fid] when using the file upload field? I either want to use this, or, use the node id it is attached to with [node:nid]. It looks like I can only use global tokens, which are not unique enough to the way I want to store the file on the server.

1 Answer 1


In core this is not possible, because the file widget sets the #upload_location when it builds the form element.

You need a module, for example File (Field) Paths. This module sets a temp path in #upload_location of the form element and sorts this out later when the file and node entity are available.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.