Archived from the Transloadit support forum. Originally posted on February 8, 2012; details may be outdated, see our docs for current behavior. Original thread
My path is set to something like “/photo/${unique_prefix}/${previous_step.name}”. When upload to s3 the url for one result is for example “/photo/74/eaa5556250f3deb2bbb9c8eda8841e/:original”. But the id is “REDACTED”. There is a “/” inserted on char(3) inside ${unique_prefix}.
Many people do not properly create subfolders by default which leads to all files being added to the same folder. By using the first two chars of the file id to artificially create another subdirectory this problem is easily prevented.
well, you don’t have to use the ${unique_prefix} variable. It is set to work this way with the slash in between, so adding a parameter to just control how unique_prefix works would be overkill.
However, if you just need a unique prefix for your upload, you could also use ${assembly.id}. Or there would be other meta information pieces that could qualify for this.
If this doesn’t help for your use case, you could also pass a unique prefix yourself to in the “path” string in your “params” field.
Please let me know why you need the unique prefix, then I can probably make better suggestions for your use case.
However, if you just need a unique prefix for your upload, you could also use ${assembly.id}.
I guess ${assembly.id} is the same for all processed files (in that assembly), right?
I would like to use a unique prefix (without slashes) file by file. Therefore using the ${assembly.id} or changing the “path”-paramenter won’t help because this affects all files in that upload. I really would like to use the “id” of the generated file. So it is ${unique_prefix} but without the added slash