Which mime type should I use for mp3

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/mime-types.shtml

.mp3    audio/mpeg3
.mp3    audio/x-mpeg-3
.mp3    video/mpeg
.mp3    video/x-mpeg

What are the difference between these, and which should I use?

145581 次浏览
clause (excluding the HAVING itself). Passing null will cause all row groups to be included, and is required when row grouping is not being

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

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

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

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

    I'm looking for better understanding of the following user story:

    John works in Sidney. At 9:00 in the morning, he logs an event in a web app that runs on a server in Zurich. The next day, he travels to New York for an emergency meeting in which the event should be discussed. During the meeting, he searches for the event by date and time.

    k time (since the event hasn't been found, the app has no way to know that it happened in Sidney, so it can't automatically select the correct time zone).

    As I see it, there are at least two issues here:

      What is a good way to ask the user for a timestamp that might include the time zone?

      The second issue is how to display the results. If teams from all over the globe need to discuss the event (and find related events, think of a cracker attack that targets several sites all over the globe at once).

    1. How should I save the time stamps in the database
    2. What is a good example for displaying timestamps that might have been created in a different time zone?

    3. How should I present them in the UI

    Note: Please concentrate on the usability of the requirement. I can figure out the database mapping myself. Currently, I'm unsure about the work flow. It should ask/present the necessary information in an non-intrusive/intuitive way. If you can, give a link to an existing web app which already solves this.

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

    The issue of storing timestamps is simple: Store them in UTC.

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

    As for displaying them, it would make sense to take the device's timezone setting and use that as the current timezone. That said, there should be a timezone dropdown next to the "time input" box, which defaults to the device's current timezone, so the user can change it if needed.

    ge it if needed.

    The majority of your users probably will not change timezones much, or at all. For the most part, the situation you outlined is uncommon. By implementing a dropdown with a suitable default, you should be able to make things easy enough for those who do move around (because they typically have a better understanding of timezones than a non-traveller would).

    The majority of your users probably will not change timezones much, or at all. For the most part, the situation you outlined is uncommon. By implementing a dropdown with a suitable default, you should be able to make things easy enough for those who do move around (because they typically have a better understanding of timezones than a non-traveller would).

    In fact, even better would be to save the timezone the device was set to when your app was first run, and then see if it ever changes. If it does change, then the user is probably a traveller and would probably benefit from having the timezone dropdown. Otherwise, just don't show the dropdown and default to the device timezone (because the user doesn't need to know about them). In either case, have a setting in the app that allows the user to manually show/hide the timezone dropdown.


    In fact, even better would be to save the timezone the device was set to when your app was first run, and then see if it ever changes. If it does change, then the user is probably a traveller and would probably benefit from having the timezone dropdown. Otherwise, just don't show the dropdown and default to the device timezone (because the user doesn't need to know about them). In either case, have a setting in the app that allows the user to manually show/hide the timezone dropdown.


    To summarise the above:

      To summarise the above:

      • On first run, save what timezone the device is set to.
      • On first run, save what timezone the device is set to.
      • Use that timezone as the default timezone. Always assume that timezone.
      • Use that timezone as the default timezone. Always assume that timezone.
      • Should the device switch timezones, add a dropdown to select which timezone the event is in, defaulting to the device's own timezone.
      • Should the device switch timezones, add a dropdown to select which timezone the event is in, defaulting to the device's own timezone.
      • Add an option to show/hide this timezone dropdown manually.
      • Always store timestamps in UTC.

    In order to validate when mime type gives a false negative you can use fleep as per this answer https://stackoverflow.com/a/52570299/14482130

    In our applications, we generally store the time zone of the user when we first registers, as often seen on forum sites, and always display time with the time zone.

    to finish the validation.

    As for storing the dates, UTC is the way to go. Convert to UTC and stick it into the database. While retrieving, simply convert the time to the timezone set for the user.

    timestamp in UTC nicely served our purpose, without hiccups.

    I had to solve a similar use case, where customized notifications, like "Happy New Year", could be sent to all users of the web app. Since users are spread out world wide, we needed to display the notification according to the timezone. Storing timestamp in UTC nicely served our purpose, without hiccups.

    In your use case, if you're not storing the user timezone somewhere you'll never be able to accurately return your search results without asking for user input, unless you start using some sort of location detection like gmaps does, but that isn't reliable. So you'll need to ask for timezone every time to make sure the user knows what he is entering in the website.

    In your use case, if you're not storing the user timezone somewhere you'll never be able to accurately return your search results without asking for user input, unless you start using some sort of location detection like gmaps does, but that isn't reliable. So you'll need to ask for timezone every time to make sure the user knows what he is entering in the website.

    If you do have timezone information, the entire web app should be run with the timezone setting. Hence when the user does search for 9:00, he'll be searching with the Sydney timezone. On the other hand, if he creates an event while sitting in New York, he'll create an event with the Sydney timezone. We solve such cases by always displaying timezone while displaying dates.

    If you do have timezone information, the entire web app should be run with the timezone setting. Hence when the user does search for 9:00, he'll be searching with the Sydney timezone. On the other hand, if he creates an event while sitting in New York, he'll create an event with the Sydney timezone. We solve such cases by always displaying timezone while displaying dates.

    Hope it helps! :)