Folders in S3 robot and Template Variables

Archived from the Transloadit support forum. Originally posted on April 29, 2012; details may be outdated, see our docs for current behavior. Original thread

Hi there,
Is it possible to upload to a specific folder within a bucket ?

My form has a hidden field called cname with a value of ‘uploadstest’.

I’m using a path of “${fields.cname}/${file.id}_${file.url_name}” in my template.

When I upload a file, I am expecting to see a folder named ‘uploadstest’ and a file named ‘${file.id}_${file.url_name}’

However I’m seeing a file named ‘/${file.id}_${file.url_name}’ and no folder.

Thanks

Got this to work by adding a fields attribute to the params JSON.

I may have misunderstood but the documentation implied that I could achieve this by using a hidden field in my form.

Cheers

Hey Kartik,

additional fields of your form also become available in the ${fields.*} variables. For that to work though you have to set the jQuery plugin’s param “fields: true”. By default, we of course do not want to submit all our user’s data to transloadit.

I hope that makes sense.

Kind regards,
Tim

Closing this. Please feel free to reply/reopen the ticket again if there is a need.