Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > override server mime type

Reply
Thread Tools

override server mime type

 
 
Dave
Guest
Posts: n/a
 
      12-03-2003
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
 
Reply With Quote
 
 
 
 
Leif K-Brooks
Guest
Posts: n/a
 
      12-03-2003
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

 
Reply With Quote
 
 
 
 
Mark Parnell
Guest
Posts: n/a
 
      12-03-2003
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
 
Reply With Quote
 
brucie
Guest
Posts: n/a
 
      12-03-2003
in post <news:(E-Mail Removed). com>
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
 
Reply With Quote
 
David Dorward
Guest
Posts: n/a
 
      12-03-2003
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/>
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with Email::MIME and Email::MIME::Attachment::Stripper ecureuil Perl Misc 0 05-28-2006 01:47 AM
tomcat 4.x : setting mime type for a directory or setting a default mime type CJ Java 1 10-29-2004 07:51 PM
how 2 convert mime to txt or extract words from mime joe Perl Misc 0 04-07-2004 12:34 AM
JSP upload - detecting file type by mime type? what is application/octet-stream? Stephen Riek Java 0 09-19-2003 03:52 AM
Receiving zip files via Mime::Parser/Mime::Decoder Jan Arickx Perl Misc 0 08-25-2003 08:24 PM



Advertisments