Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    Regular Coder
    Join Date
    Jan 2005
    Posts
    470
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Exclamation Firefox disregarding header content type

    I have a script setup to transmit audio files listed in a database. Everything works fine with Internet Explorer but Firefox insists everytime that the file is a PHP file instead of an audio file.

    For instance, if I use the following header code then IE won't have a problem but Firefox will:
    PHP Code:
    header('Content-Description: File Transfer');
    header('Content-type: audio/x-m4a');
    header('Content-Disposition: attachment; filename=audio_sample.m4a;');
    header('Content-Transfer-Encoding: binary');
    header('Content-Length: 182058'); 
    Anyone else experience this?

  • #2
    Senior Coder nikkiH's Avatar
    Join Date
    Jun 2005
    Location
    Near Chicago, IL, USA
    Posts
    1,973
    Thanks
    1
    Thanked 32 Times in 31 Posts
    Mime type?
    Server mime type?
    I don't see the first, and double-check the second.

    If this post contains any code, I may or may not have tested it. It's probably just example code, so no getting knickers in a bunch over a typo, OK? If it doesn't have basic error checking in it, such as object detection or checking if objects are null before using them, put that in there. I'm giving examples, not typing up your whole app for you. You run code at your own risk.
    Bored? Visit
    http://www.kaelisspace.com/

  • #3
    Regular Coder
    Join Date
    Jan 2005
    Posts
    470
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by nikkiH
    Mime type?
    Server mime type?
    I don't see the first, and double-check the second.
    What do you mean? The mime-type is sent in the header "Content-type: audio/x-m4a" as shown above.

  • #4
    Regular Coder
    Join Date
    Feb 2005
    Location
    West Midlands, UK
    Posts
    623
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Try capitalising the type field, that's the correct setting although I don't know if it's causing your problem it may cause problems with some browsers.

    PHP Code:
    header(Content-Type 

  • #5
    Regular Coder
    Join Date
    May 2004
    Posts
    144
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I've had that problem with mime types also. i had to use two different ones for excel for ff/ie compatability.

    here is a nice list of types if you don't have one.:

    http://www.webmaster-toolkit.com/mime-types.shtml

    c.c.

  • #6
    Regular Coder
    Join Date
    Jan 2005
    Posts
    470
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by delinear
    Try capitalising the type field, that's the correct setting although I don't know if it's causing your problem it may cause problems with some browsers.

    PHP Code:
    header(Content-Type 
    Tried that just now but it didn't resolve the problem.

  • #7
    Regular Coder
    Join Date
    Jan 2005
    Posts
    470
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by ClubCosmic
    I've had that problem with mime types also. i had to use two different ones for excel for ff/ie compatability.

    here is a nice list of types if you don't have one.:

    http://www.webmaster-toolkit.com/mime-types.shtml

    c.c.
    Thanks for the list. Oddly, there isn't an entry for "m4a".

  • #8
    Senior Coder
    Join Date
    Aug 2003
    Location
    One step ahead of you.
    Posts
    2,815
    Thanks
    0
    Thanked 3 Times in 3 Posts
    m4a is not very popular... can't you set the Content-Type to something else?
    I'm not sure if this was any help, but I hope it didn't make you stupider.

    Experience is something you get just after you really need it.
    PHP Installation Guide Feedback welcome.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •