Storing uploaded files according to node ID When a file/image is uploaded via Drupal, they go into a common directory specified by the administrator.

However, is there a way to specify where the files will be uploaded, according to their node ID? For example, say, a person creates a page and Drupal assigns it an ID of 1234; thus, the uploaded files will go into {specified_location}/1234_files/.
You can use the File (Field) Paths module in combination with the Token module for this.


Enable module
Go to admin/structure/types/manage/your_content_type/fields/your_file_field
Make sure Enable File (Field) Paths? is enabled.
Under File (Field) Path settings you can now use e.g. myfiles/[node:nid]