Drupal 6 Setting a dynamic path for imagefield uploads

webadmin's picture
Drupal

Just a quick post to share this great little gem of a module: filefield paths.

This module allows you to set a custom dynamic path using tokens for your files or images uploaded through CCK’s filefield or imagefield. Why is this great? Because it allows you to structure files on your server and avoid having thousands of files in the same folder. Without this module, you are limited to (useless) user tokens or one static upload path.

When you enable this module, you get a lot of extra node/date/content-type tokens and can easily configure an upload path like:

Now, all images in that particular node will be available in a folder named with the unique node-id. And imagecache will also respect this path to put its derivative images. This is really recommended when you build big sites with hundreds of nodes and each node has many images.

http://drupal.org/project/filefield_paths