override server mime type

Discussion in 'HTML' started by Dave, Dec 3, 2003.

  1. Dave

    Dave Guest

    Hi,

    I am trying to link to an mp3 file, as follows:


    <a href="http://someserver.somedomain.com/somefile.mp3">
    SomeNeatLinkText </a>

    However, instead of downloading or playing the mp3., my browser seems
    to just display a screenful of garbage. I am assuming this is because
    the server is not sending the correct mime type. Is there any way to
    override this? I tried

    <a href="http://someserver.somedomain.com/somefile.mp3"
    type="audio/x-mpeg"> SomeNeatLinkText </a>


    but that doesn't seem to work. Any suggestions i can implement from my
    side(i.e. other than 'contact the server admin and get him to fix the
    server's configuration').

    gracias,
    Dave
    Dave, Dec 3, 2003
    #1
    1. Advertising

  2. Dave wrote:
    > I am trying to link to an mp3 file, as follows:
    >
    >
    > <a href="http://someserver.somedomain.com/somefile.mp3">
    > SomeNeatLinkText </a>
    >
    > However, instead of downloading or playing the mp3., my browser seems
    > to just display a screenful of garbage. I am assuming this is because
    > the server is not sending the correct mime type. Is there any way to
    > override this?


    If you're using Apahce and .htaccess is enabled, you can use an AddType
    directive. http://httpd.apache.org/docs/mod/mod_mime.html#addtype
    Leif K-Brooks, Dec 3, 2003
    #2
    1. Advertising

  3. Dave

    Mark Parnell Guest

    Sometime around 2 Dec 2003 19:08:31 -0800, Dave is reported to have stated:
    > Hi,
    >
    > I am trying to link to an mp3 file, as follows:
    >
    > However, instead of downloading or playing the mp3., my browser seems
    > to just display a screenful of garbage. I am assuming this is because
    > the server is not sending the correct mime type. Is there any way to
    > override this?
    >


    You may[1] be able to set it to use the correct mime type in your
    ..htaccess[2] file.

    Just add the line:

    AddType audio/x-mpeg mp3

    HTH


    [1] Depending on how much control your host has given you. :)
    [2] Assuming your site is hosted on an Apache server. A .htaccess file is a
    plain text file called exactly that (if creating it in Notepad, save it
    with quotes around the name, i.e. ".htaccess", to prevent Notepad from
    adding a .txt extension). Upload it to your site root, and try your mp3
    again.

    --
    Mark Parnell
    http://www.clarkecomputers.com.au
    Mark Parnell, Dec 3, 2003
    #3
  4. Dave

    brucie Guest

    in post <news:>
    Dave said:

    > <a href="http://someserver.somedomain.com/somefile.mp3">
    > SomeNeatLinkText </a>
    > However, instead of downloading or playing the mp3., my browser seems
    > to just display a screenful of garbage. I am assuming this is because
    > the server is not sending the correct mime type.


    you're probably right, who knows, you haven't supplied a URL for people
    to see if that is the case or not.

    assuming your server is apache:
    http://www.softbrain.co.kr/CPANdoc/Apache/MP3.html

    --
    brucie
    03/December/2003 01:33:38 pm kilo
    brucie, Dec 3, 2003
    #4
  5. Dave wrote:
    > However, instead of downloading or playing the mp3., my browser seems
    > to just display a screenful of garbage. I am assuming this is because
    > the server is not sending the correct mime type. Is there any way to
    > override this? I tried
    >
    > <a href="http://someserver.somedomain.com/somefile.mp3"
    > type="audio/x-mpeg"> SomeNeatLinkText </a>


    The type attribute is informative, not authoritative. The content-type
    header sent by the server is authoritative. You have to change the content
    type sent by the server.

    --
    David Dorward <http://dorward.me.uk/>
    David Dorward, Dec 3, 2003
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Stephen Riek
    Replies:
    0
    Views:
    4,433
    Stephen Riek
    Sep 19, 2003
  2. CJ
    Replies:
    1
    Views:
    1,567
    Andrew Thompson
    Oct 29, 2004
  3. Jan Arickx
    Replies:
    0
    Views:
    195
    Jan Arickx
    Aug 25, 2003
  4. joe
    Replies:
    0
    Views:
    190
  5. ecureuil
    Replies:
    0
    Views:
    324
    ecureuil
    May 28, 2006
Loading...

Share This Page