In Drupal 7, while attempting to specify the "File directory" option as "fields/field_foo/[node:nid]" in an image field configuration, the form does not validate. The error text is: "The File directory is using the following invalid tokens: [node:nid]".

As per File (Field) Paths, core does not support node tokens for this. This is a feature request to get this into core. It will greatly help folks keep their "files" directory clean.

Also see ImageField Tokens.

Comments

I'm happy to lend a hand with issue, but it's worth noting that the reason that Node (or Entity) tokens don't work by default is that they aren't necessarily known until after the Node (or Entity) has been saved, which is why File (Field) Paths does the processing after the Node (or Entity) has been saved.

+1

Issue summary:View changes

Added link to second contrib project.