If I understand the following FAQ item correct:

Why are my files uploaded to 'files/[nid]' instead of 'files/1'?
When you are creating or updating a node the full values for the Node tokens may not yet be known by Drupal, so the File (Field) Paths module will upload your files to a temporary path based on your filepath pattern ('files/[nid]') and then once you save the node and Drupal is provided with the Node tokens values the file will be moved to the appropriate location.

this module adds some clean-up magic so own nid can be used even when files are uploaded before the node is saved the first time?

Kristoffer Wiklund and I have started a sandbox project, Pre content create, that is related to this. It allows for an extra step before the normal edit form that makes sure a node is saved and thus nid allocated before users can, for example, upload files.

See the What this module does section in http://www.tsvenson.com/blog/2014/08/how-open-source-worx for some more details about the ideas we are toying with and some screenshots.

I think our little project and this module have some interesting potential together that I am going to explore more about.

Comments

tsvenson’s picture

Issue summary: View changes
Deciphered’s picture

Yes, you are correct, that this module was created specifically to tackle the issue of using Node tokens which aren't yet available at the point which the File is uploaded.

It does sound like an interesting module, and it would certainly help with the same sort of usecase that File (Field) Paths has, however it does have the potential downside of adding an additional step into the content creation process.

I would absolutely like to talk more about this though.

Deciphered’s picture

Status: Active » Fixed

So I thought more on this, and I came up with another reason why the approach of Pre content create isn't really a solution:

Any field or property that isn't yet known, not just the Node ID, could be used in the token for the File path/name, so even if File (Field) Paths depended on Pre content create it would still have to do things the way it is doing them.

I'm going to close this issue for the moment, but I am still interested in discussion further at some stage as it seems that we are both tackling the same sort of issue.

Status: Fixed » Closed (fixed)

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