override server mime type

D

Dave

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
 
L

Leif K-Brooks

Dave said:
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
 
M

Mark Parnell

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.
 
B

brucie

D

David Dorward

Dave said:
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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top