Allow an admin to configure sub-directories of the site files directory (utilising token module support for directory options). e.g. following the pattern [author-uid] or [yyyy]

The Upload Path module does this for uploads via the upload module but it does not extend beyond that and I don't think the developer is going to extend the functionality (http://drupal.org/node/132954)

CommentFileSizeAuthor
#4 imagefield-DRUPAL-5--2.token_.patch545 bytessun

Comments

yan’s picture

I'd like support this. I opened a thread for this in the forum. I'd like to store pictures in subfolders by yyyy/mm

bobdalob’s picture

I came across a HEAD version (found here) which supports ajax uploads (so no page refresh just to upload).

There is some token support for saving image files to subdirectories - although not quite as extensive as the token module/image module combination (there is no YYYY or MM) however I tried one or two tokens and they worked. I have tried out this version, on a test site, and can report this is a pleasing step forward for the module. I hope this gets incorporated very soon.

quicksketch’s picture

Yes the feature you're requesting has already been implemented into the imagefield 2.x version. This version is still a bit unstable, but I believe it includes all the features you're requesting here.

sun’s picture

Version: 5.x-1.1 » 5.x-2.x-dev
Component: Miscellaneous » Code
Category: feature » bug
Status: Active » Reviewed & tested by the community
StatusFileSize
new545 bytes

The dependency on token module is missing, which leads to a 404 upon uploading an image.

dsnydernc’s picture

Using Token parameters in the latest version works just fine for me - but I would like to request the use of tokens be extended. Currently the available tokens for use with Image Field is limited, tokens such as vocab and term are not available.

stormsweeper’s picture

The settings are using the "user" tokens, which only pull the current user. I'd prefer it to use the "node" tokens. The use case I ran into a problem with was a nodeprofile node - on registration the user id is 0, so there were name collisions for uploaded files. I've changed it to use the node tokens and author-uid works fine. I can submit a patch if need be.

quicksketch’s picture

Status: Reviewed & tested by the community » Needs work

The token module is not actually a dependency (or shouldn't be at least). A patch that makes imagefield not throw an error if token is not present would be preferable.

sun’s picture

Weird... I'm no longer able to reproduce this bug with latest development snapshot of Imagefield v2.x.

momper’s picture

The settings are using the "user" tokens, which only pull the current user. I'd prefer it to use the "node" tokens. The use case I ran into a problem with was a nodeprofile node - on registration the user id is 0, so there were name collisions for uploaded files. I've changed it to use the node tokens and author-uid works fine. I can submit a patch if need be.

this would be excellent ...

greetings momper

bfsworks’s picture

Maybe pathauto can be used to generate the upload path for images. I support any changes to allow node tokens or path auto. Separating images into directories is a bid plus especially if you have thousands of images!

dopry’s picture

Status: Needs work » Closed (fixed)

You will not be able to use node tokens, these values are not permanent values at the time of the upload, often before a node actually exists. Only user tokens will be available for now.

I cannot reproduce this bug either...

Please open a new issue fore regressions or feature requests...

yan’s picture

Great that token support is going to be included in 5.x-2.x-dev. I'm waiting a while for that already. Thanks!

One thing though: I was hoping to be able to use [yyyy] and [mm] for year and month, but it doesn't work. Instead there are a couple of date functions ([site-date][log-date][date-in-tz][account-edit]) but they give out really weird folders like

/Thu, 12/13/2007 - 17:45/

I'd be great if more usability was added to this, providing tokens that make more sense for paths.

yan’s picture

Version: 5.x-2.x-dev » 5.x-2.0-rc6
Status: Closed (fixed) » Active

Is this (#12) impossible, too? It works for upload path with the upload module at least. In that case it is possible to use [yyyy], [mm], etc. As far as I know on creation the current time is used and on update the $node->created time.

dopry’s picture

Status: Active » Closed (fixed)

You're really looking for extensions to the Token Module... I suggest you review http://drupal.org/node/236596, if you really want these features.