Archived from the Transloadit support forum. Originally posted on January 17, 2011; details may be outdated, see our docs for current behavior. Original thread
Per the docs:
${unique_prefix} A unique 33 character prefix you can use to avoid file name collisions. Example: “f2/d3eeeb67479f11f8b091b04f6181ad”
Is the format always 2 characters followed by a slash (“/”) followed by the remaining 30 characters? The reason I ask is because when a file is processed it returns an [ID] in the Results array, which looks like this:
[id] => REDACTED
which seems to be the same as “unique_prefix”, just without the “/” at the 3rd character. I may be storing the ID in my DB, and want to be able to accurately reconstruct the s3 path to the file.
I may be storing the ID in my DB, and want to be able to accurately reconstruct the s3 path to the file.
Yes, the ${unique_prefix} is based on the file id, and we probably won’t change that anytime soon.
But I would recommend you to not build on this assumption. I mean you’ll save a few bytes in your db, but if your url scheme ever changes, this will be a pain to maintain.
What about passing variables from our form to be used in the path? I have a unique domain key that I would love to use in storing the S3 files so that each of my domains would show up as a different folder under the bucket.
Unfortunately we can’t do it that way. That’s because eventually all of our robots will be realtime, and we may not have received your variable yet when the step is executed.
In my previous comment I was trying to explain that you can “overwrite” the path parameter of your template inside the params field you send to transloadit. Hit me up on skype tomorrow and I can explain this further!