Help get this topic noticed by sharing it on Twitter, Facebook, or email.
I’m blurg

Configure MIME types

I am developing an application which uses html5 audio tags. IE9 requires mp3's to have a MIME type of audio/mp3, however, iris is serving up my mp3's with a MIME type of audio/x-mpg. Any way I can change the configuration of this? Thanks.
1 person has
this problem
+1
Reply
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. kidding, amused, unsure, silly indifferent, undecided, unconcerned sad, anxious, confused, frustrated happy, confident, thankful, excited

  • Actually you can set your own MIME-Type at the moment your are uploading an attachment... Take a look on the Apache-Wikis, near "Standalone Attachments":

    http://wiki.apache.org/couchdb/HTTP_D...

    For example, i uploaded an attachment, actually an image/png. First without adding my own information. So CouchDB goes to interpret it by itself.


    $ curl -X PUT http://username:password@localhost:5984/myDB/myDoc/testimage.png?rev=... --data-binary @testimage.png


    After that i uploaded an attachment with adding my own header information, text/plain:


    $ curl -X PUT http://username:password@localhost:5984/myDB/myDoc/testimage2.png?rev=... --data-binary @testimage.png -H "Content-Type: text/plain: charset=utf-8"


    So, take a look in Futon... Or call it via curl....


    < HTTP/1.1 200 OK
    < Server: CouchDB/1.0.1 (Erlang OTP/R14B)
    < ETag: "5-7fcf31ff7fdd57c5819fa99c49a71ccb"
    < Date: Wed, 18 Apr 2012 06:25:12 GMT
    < Content-Type: text/plain; charset=iso-8859-1
    < Content-Length: 5281
    < Cache-Control: must-revalidate


    You can see, there is the MIME-Type/Content-Type you set.

    Hope that helps...
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. kidding, amused, unsure, silly indifferent, undecided, unconcerned sad, anxious, confused, frustrated happy, confident, thankful, excited

  • I’m moving on
    Dennis,

    Thanks for the reply. Yeah, after a bit of research on my end, I read that I can set the MIME type upon uploading an attachment. However, in this case I am not uploading them. These are application assets that are drag/dropped into my local couchapp _attachments directory and uploaded via 'couchapp push'. In this case there is not an opportunity for me to set the MIME type (that I can tell). Actually, I have punted and decided to use jPlayer to play my audio files. Which has raised another issue, which I think is appropriate for a new thread.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. kidding, amused, unsure, silly indifferent, undecided, unconcerned sad, anxious, confused, frustrated happy, confident, thankful, excited

  • Actually, same x-mpg issue in IE9 so I do need to figure this out :(
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. kidding, amused, unsure, silly indifferent, undecided, unconcerned sad, anxious, confused, frustrated happy, confident, thankful, excited