Can't add arbitrary headers to S3 store

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

On this issue, https://community.transloadit.com/t/external_id/tender-problems-469 you asked:

“I just looked into this, but I’m not entirely sure what is going on yet. What’s the FileURL header you are setting for? Does the problem occur when not specifying that header?”

In the docs for headers (http://transloadit.com/docs/s3-store) the example is: {FileURL. This implies that we could use “FileURL” as a header and further more implies that we could use any header we wanted. I tried adding headers like X-Width, X-Height, and X-Video-Duration so I could have someway to track the extracted data. Every time I did, the assembly would fail. Can we use arbitrary headers? If not, could we get a way to store the completed assembly as JSON on S3 so we can get the metrics from the videos/images from somewhere close to the data (as opposed to having to login to the transloadit api)?

Hey,

sorry for the delay here, this ticket slipped through the cracks. :frowning:

I am not sure why the assemblies would crash when you change the headers. We will look into that.

Regarding the json on s3, you can use our s3 storage for it:

http://jsondb.transloadit.com.s3.amazonaws.com/assemblies/[[your_assembly_id]].json

Please let me know if that helps.

Kind regards,
Tim

Is this the same as the problem I was having, you can’t set a header to an empty string (It gives a bad S3 signature error)

This is ok: "x-amz-meta-test":"something"
This Fails: "x-amz-meta-test":""

So, if you use something like ‘meta.duration’ which might not always exist it fails:

"x-amz-meta-duration":"${file.meta.duration}"

The way I worked around it is to prefix it with something so the field is never empty:

"x-amz-meta-duration":"prefix:${file.meta.duration}"

As its a number I just used a ‘0’ so its still easy to parse:

"x-amz-meta-duration":"0${file.meta.duration}"

@acorcutt: That seems like a reasonable workaround for now. We’ll investigate why the signature mechanism fails to deal with the empty header value scenario.

Created an internal todo ticket. Will close this ticket for now.

This is now properly fixed!

Closing again.