Which mime type should I use for mp3

前端 未结 5 2186
滥情空心
滥情空心 2020-11-29 02:45

I\'m trying to decide which mime type to choose for returning mp3 data (served up by php)

according to this listing of mime types: http://www.webmaster-toolkit.com/m

相关标签:
5条回答
  • 2020-11-29 03:03

    Your best bet would be using the RFC defined mime-type audio/mpeg.

    0 讨论(0)
  • 2020-11-29 03:03

    Use .mp3 audio/mpeg, that's the one I always used. I guess others are just aliases.

    0 讨论(0)
  • 2020-11-29 03:05

    You should always use audio/mpeg, because firefox cannot play audio/mpeg3 files

    0 讨论(0)
  • 2020-11-29 03:10

    The standard way is to use audio/mpeg which is something like this in your PHP header function ...

    header('Content-Type: audio/mpeg');

    0 讨论(0)
  • 2020-11-29 03:15

    I had a problem with mime types and where making tests for few file types. It looks like each browser sends it's variation of a mime type for a specific file. I was trying to upload mp3 and zip files with open source php class, that what I have found:

    • Firefox (mp3): audio/mpeg
    • Firefox (zip): application/zip
    • Chrome (mp3): audio/mp3
    • Chrome (zip): application/octet-stream
    • Opera (mp3): audio/mp3
    • Opera (zip): application/octet-stream
    • IE (mp3): audio/mpeg
    • IE (zip): application/x-zip-compressed

    So if you need several file types to upload, you better make some tests so that every browser could upload a file and pass mime type check.

    0 讨论(0)
提交回复
热议问题