Well not "messed" up. They do work, but it splits all files into many separate folders depending on the minutes they were created.
Is it possible to have a token, like [site-yymmdd] that creates a single folder within my files directory like "audio/090501" then "pdf/090501", etc. No minutes or whatever.
I need to have an organized upload path, and the File Paths settings seems so close to what I need.
I know it can be done with some combination of time() and date() PHP functions, however, would it be hard to do in this module? What .INC files handle it?
Thanks
Comments
Comment #1
esend7881 commentedWow, I just found this http://drupal.org/project/file_aliases
But it is in development mode. Anyone think it is "okay" to put on a commerce web site..?
Or does anyone know what aspects of it are insecure, maybe I could put on my coding gloves and have a look inside..
Comment #2
quicksketchThey're not "messed up" at all, you just need to use them correctly. You're not limited to using a single token per directory, just put all the existing ones right next to each other like
audio/[site-date-yy][site-date-mm][site-date-dd].Comment #3
esend7881 commentedOh, I didn't realize tokens worked like that. So we just say [site-date-yy] and that will give 09?
Thanks a lot!
Is this common drupal knowledge?
Comment #4
quicksketchYep, that's the way it works for any token. Just put in the token placeholder and it will be swapped out for a dynamic value. It's pretty common Drupal knowledge, but not "base-level". Since it requires the token.module, not all sites have this functionality, but at the same time, use of tokens is required for PathAuto module (which is very popular) and token.module itself is the 3rd most installed module from all of drupal.org (http://drupal.org/project/usage), behind only Views and CCK.
Comment #5
esend7881 commentedUmm..
I just did a test run and used this as my Path:
magazine-files/reference-material/audio/[site-date-yy][site-date-mm][site-date-dd]And that was the name of the folder.. literally.
I do have Token module enabled.
Is there a step I am missing here?
Comment #6
quicksketchThat should be it. You're running 3.0 RC1 (according to the report), so FileField should have token support enabled. When you configure the field, does it list all the available tokens beneath the path settings? If that list of tokens is there (they're there automatically if you have Token enabled), then it should work with the settings you describe. I tested this out again and it works.
Comment #7
esend7881 commentedI am running 3.0, but I'm not sure if it is RC1. It is just the one that you download and recommended to use (released 4/21). I may have mislabeled it.
Does this change things? I dont' see the specific [site-date-yy]. I only see the [site-date] alone.
Comment #8
quicksketchThe tokens available are dependent on your version of Token.module, not FileField. I'd recommend upgrading your token module and see if that gets you the needed tokens.
Comment #9
esend7881 commentedI am using the latest stable version of tokens.module 6.x.1.11
This is the list of tokens I can use: http://drupal.org/node/390482
I don't see [site-date-yy] or anything like that.
Are you using a module that extends tokens? If so, which one?
Comment #10
esend7881 commentedI applied this patch:
http://drupal.org/files/issues/token-date-d5.patch
And it did the trick
Thanks!
Comment #11
quicksketchAh, okay. I've been running the development version which already includes this change (see #236596: Add support for date parts YYYY, MM, and DD). Applying the patch as you have done is just fine, since that change will be included in the next version of token module (1.12) when it comes out.