Switch to Bing in English
Copilot
Your everyday AI companion
About 1,600,000 results
    Upvotes795Top Answeredited Oct 7, 2021 at 7:34

    RFC 7111

    There is an RFC which covers it and says to use text/csv.

    This RFC updates RFC 4180.

    Excel

    Recently I discovered an explicit mimetype for Excel application/vnd.ms-excel. It was registered with IANA in '96. Note the concerns raised about being at the mercy of the sender and having your machine violated.

    Media Type: application/vnd.ms-excel

    Name Microsoft Excel (tm)

    Required parameters: None

    Optional parameters: name

    Encoding considerations: base64 preferred

    Security considerations: As with most application types this data...

    Content Under CC-BY-SA license
    Was this helpful?
  1. PHP: mime_content_type - Manual

  2. What MIME type should I use for CSV? - Stack Overflow

  3. People also ask
    The mime type of the file, if the browser provided this information. An example would be "image/gif". This mime type is however not checked on the PHP side and therefore don't take its value for granted. So as you can see, even if $_FILES['userfile']['type'] is specified, it only corresponds to the Content-Type header sent by the client.
    According to RFC 4180, the correct MIME type for a CSV file is text/csv. You should set the Content-Type header of the response to text/csv. That will ensure that the browser understands the response as a CSV file and can handle it correctly. But that's not all you have to do. Let's examine the other headers you should set as well.
    Returns the MIME content type for a file as determined by using information from the magic.mime file. Path to the tested file. Returns the content type in MIME format, like text/plain or application/octet-stream , or false on failure. Upon failure, an E_WARNING is emitted. Example #1 mime_content_type () Example The above example will output:
    The following two important MIME types are the default types: text/plain is the default value for textual files. A textual file should be human-readable and must not contain binary data. application/octet-stream is the default value for all other cases. An unknown file type should use this type.
  4. 【PHP】PHP8.0以降の mime_content_type でCSVファイルが ...

  5. PHP: mime_content_type - Manual

  6. Common MIME types - HTTP | MDN - MDN Web Docs

  7. よくある MIME タイプ - HTTP | MDN - MDN Web Docs

  8. Sending a CSV File as an HTTP Response – devgem.io

  9. PHP: mime_content_type - Manual - php.sh

  10. mime_content_type - PHP Documentation - TypeError

  11. アップロードしたファイルがcsv形式かどうか調べたい(php) そ …

  12. Some results have been removed
By using this site you agree to the use of cookies for analytics, personalized content, and ads.Learn more about third party cookies|Microsoft Privacy Policy