# Dynamic headers problem

**URL:** <https://community.transloadit.com/t/dynamic-headers-problem/18109>\
**Category:** Transloadit\
**Tags:** tender-archive\
**Created:** [July 18, 2012, 6:21pm UTC](https://community.transloadit.com/t/dynamic-headers-problem/18109 "2012-07-18T18:21:00Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cameron\_Westlan](https://avatars.discourse-cdn.com/v4/letter/c/35a633/32.png) [@Cameron\_Westlan](https://community.transloadit.com/u/Cameron_Westlan)\
**Post date:** [July 18, 2012, 6:21pm UTC](https://community.transloadit.com/t/dynamic-headers-problem/18109/1 "2012-07-18T18:21:00Z")

</div>

> Archived from the Transloadit support forum. Originally posted on July 18, 2012; details may be outdated, see [our docs](https://transloadit.com/docs/) for current behavior. [Original thread](https://web.archive.org/web/20141230215344/http://support.transloadit.com/discussions/problems/830-dynamic-headers-problem)

Hey guys,

I’ve got a template that looks like this:

```auto
{ "steps": {
    "mp3": {
      "use": ":original",
      "robot": "/audio/encode",
      "preset": "mp3"
    },
    "theora.ogv": {
      "use": ":original",
      "robot": "/audio/encode",
      "ffmpeg": {
        "acodec": "libvorbis",
        "f": "ogg"
      }
    },
    "store-mp3": {
      "use": ["mp3"],
      "robot": "/s3/store",
      "path": "${unique_prefix}.${previous_step.name}",
      "bucket": "kera-production",
      "key": "",
      "secret": ""
    },
    
    "store-ogg": {
      "use": ["theora.ogv"],
      "robot": "/s3/store",
      "path": "${unique_prefix}.${previous_step.name}",
      "headers": { "Content-Type": "audio/ogg" },
      "bucket": "kera-production",
      "key": "",
      "secret": ""
    }
} }

```

I NEED the ogg format to be stored with the header ‘audio/ogg’ for use with Firefox/HTML5. Is there a more efficient way of doing this? By default the content type for ogg is set to x-audio/ogg. Ideally I’d specify a variable in the /audio/encode step which can be used in the ‘store’ step but I’m not sure if this is possible?

Thanks.

-Cameron

---

<div class="post-metadata">

**Author:** ![tim-kos](https://avatars.discourse-cdn.com/v4/letter/t/bbe5ce/32.png) [@tim-kos](https://community.transloadit.com/u/tim-kos)\
**Post date:** [July 19, 2012, 7:18am UTC](https://community.transloadit.com/t/dynamic-headers-problem/18109/2 "2012-07-19T07:18:00Z")

</div>

Hey Cameron,

thanks for submitting the ticket.

I am not quite sure, though, what the questions is, because your syntax with the Content-type header looks just fine and is also the most efficient way.

Could you please explain more how you intend the variable to work? Maybe you mean something like this: [https://transloadit.com/docs/passing-fields-and-variables-into-templates](https://transloadit.com/docs/passing-fields-and-variables-into-templates) ?

Kind regards,  
Tim

---

<div class="post-metadata">

**Author:** ![Cameron\_Westlan](https://avatars.discourse-cdn.com/v4/letter/c/35a633/32.png) [@Cameron\_Westlan](https://community.transloadit.com/u/Cameron_Westlan)\
**Post date:** [July 19, 2012, 1:28pm UTC](https://community.transloadit.com/t/dynamic-headers-problem/18109/3 "2012-07-19T13:28:00Z")

</div>

Hey Tim,

The Content-Type header IS fine. My concern is that I’ve had to add two different /s3/store robots in order to accomplish the task. This means a lot of the configuration for those robots are duplicated causing a maintenance headache. It would be nicer if I could set the content-type dynamically based on the previous steps. Please take a closer look and I think it should be obvious.

-Cameron

---

<div class="post-metadata">

**Author:** ![Felix\_Geisendorfer](https://yyz2.discourse-cdn.com/flex032/user_avatar/community.transloadit.com/felix_geisendorfer/32/1463_2.png) [@Felix\_Geisendorfer](https://community.transloadit.com/u/Felix_Geisendorfer)\
**Post date:** [July 21, 2012, 2:07pm UTC](https://community.transloadit.com/t/dynamic-headers-problem/18109/4 "2012-07-21T14:07:00Z")

</div>

Sorry for the confusion. I see what you mean. Unfortunately our API currently does not allow for a more efficient way to deal with this. That being said, it seems like we could also solve your problem by making sure we make `audio/ogg` the default header for ogg? What do you think?

---

<div class="post-metadata">

**Author:** ![Cameron\_Westlan](https://avatars.discourse-cdn.com/v4/letter/c/35a633/32.png) [@Cameron\_Westlan](https://community.transloadit.com/u/Cameron_Westlan)\
**Post date:** [July 21, 2012, 2:39pm UTC](https://community.transloadit.com/t/dynamic-headers-problem/18109/5 "2012-07-21T14:39:00Z")

</div>

That would be fantastic if you could do that. I was trying to see if there was an argument that I could pass to ffmpeg or something to no avail.

Is that a possibility?

---

<div class="post-metadata">

**Author:** ![Felix\_Geisendorfer](https://yyz2.discourse-cdn.com/flex032/user_avatar/community.transloadit.com/felix_geisendorfer/32/1463_2.png) [@Felix\_Geisendorfer](https://community.transloadit.com/u/Felix_Geisendorfer)\
**Post date:** [July 21, 2012, 2:39pm UTC](https://community.transloadit.com/t/dynamic-headers-problem/18109/6 "2012-07-21T14:39:00Z")

</div>

Yes, that’s possible.

Tim: Can you hack this in?

---

<div class="post-metadata">

**Author:** ![tim-kos](https://avatars.discourse-cdn.com/v4/letter/t/bbe5ce/32.png) [@tim-kos](https://community.transloadit.com/u/tim-kos)\
**Post date:** [October 31, 2012, 7:13am UTC](https://community.transloadit.com/t/dynamic-headers-problem/18109/7 "2012-10-31T07:13:00Z")

</div>

Hacked this in a few weeks ago. Enjoy!

Closing this ticket for now.

---

<div class="post-metadata">

**Author:** ![Cameron\_Westlan](https://avatars.discourse-cdn.com/v4/letter/c/35a633/32.png) [@Cameron\_Westlan](https://community.transloadit.com/u/Cameron_Westlan)\
**Post date:** [October 31, 2012, 12:40pm UTC](https://community.transloadit.com/t/dynamic-headers-problem/18109/8 "2012-10-31T12:40:00Z")

</div>

Ok so what does that mean? That I don’t need to specify the header anymore?  
What should I change my template to look like after your “hack”?

---

<div class="post-metadata">

**Author:** ![tim-kos](https://avatars.discourse-cdn.com/v4/letter/t/bbe5ce/32.png) [@tim-kos](https://community.transloadit.com/u/tim-kos)\
**Post date:** [November 5, 2012, 8:18am UTC](https://community.transloadit.com/t/dynamic-headers-problem/18109/9 "2012-11-05T08:18:00Z")

</div>

The “hack” automatically sets the proper Content-type header if the file that needs storing is identified to have the audio/ogg mime type.

kind regards,  
Tim

Co-Founder Transloadit  
@tim\_kos

---

<div class="post-metadata">

**Author:** ![Cameron\_Westlan](https://avatars.discourse-cdn.com/v4/letter/c/35a633/32.png) [@Cameron\_Westlan](https://community.transloadit.com/u/Cameron_Westlan)\
**Post date:** [November 5, 2012, 1:29pm UTC](https://community.transloadit.com/t/dynamic-headers-problem/18109/10 "2012-11-05T13:29:00Z")

</div>

Ok Tim thanks.

---

<div class="post-metadata">

**Author:** ![tim-kos](https://avatars.discourse-cdn.com/v4/letter/t/bbe5ce/32.png) [@tim-kos](https://community.transloadit.com/u/tim-kos)\
**Post date:** [November 9, 2012, 10:36am UTC](https://community.transloadit.com/t/dynamic-headers-problem/18109/11 "2012-11-09T10:36:00Z")

</div>

Alright, closing this ticket.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex032/uploads/transloadit/original/1X/04ee57da0cb7ac8728a9ac5965c288164f4ce280.svg) [@system](https://community.transloadit.com/u/system)\
**Post date:** [October 7, 2026, 10:09am UTC](https://community.transloadit.com/t/dynamic-headers-problem/18109/12 "2026-10-07T10:09:31Z")

</div>

Closed on October 7, 2026, 10:09am UTC


