incorrect mime-type for csv-files
Reported by heiko.ad...@gmail.com, Jul 26 2012
Chrome Version : 20.0.1132.57 (Offizieller Build 145807) m OS Version: 6.1 (Windows 7, Windows Server 2008 R2) Other browsers tested: Firefox 14.x: OK What steps will reproduce the problem? 1. create a website containing a <input type="file" id="uploadFile" name="uploadFile" size="50"> 2. upload a csv-file and check the mime-type of that file What is the expected result? Chrome sends "application/vnd.ms-excel" as mime-type What happens instead? Chrome should send either "text/csv" or "text/comma-seperated-value" as mime-type Please provide any additional information below. Attach a screenshot if possible.
Jul 26 2012,
Labeling this a network bug, in the hopes that someone more familiar with where upload mime types come from (WebKit? The Windows registry? Format sniffing in net/?) can better triage this bug.
Jul 26 2012,
Jul 30 2012,
Incorrect mime-type for csv-files when downloading a dynamically created csv file: There is another issue happened when I download a dynamically created csv file. The file name is always set as "export" (which is the path name), but not the "list.csv" in the response headers. Is that a bug associated with this issue? Response Headers: ---------------------------------------------------------- Content-Disposition:: attachment; filename=list.csv; Content-Length:2050 Content-Type:text/csv;charset=MS932 ----------------------------------------------------------
Jul 30 2012,
I don't think so. In my case its about uploading files and the mime-type which chrome sends to the server is incorrect
Jul 30 2012,
minzhiR: You have two colons after Content-Disposition. Per spec (http://www.w3.org/Protocols/rfc2616/rfc2616-sec19.html), I believe there also shouldn't be an extra semi-colon at the end of the line, though I assume we do handle that case.
Jul 30 2012,
As mentioned in Comment #5, the Content-Disposition is malformed due to the extra : character. There's an effort to harmonize the error handling behavior of all the browsers, and we've implemented the latest version of the spec. Thanks for reporting the issue. Ideally, we'd like all browsers to implement the spec, so we're likely to wait a bit before changing our behavior here to see if this issue occurs on more web sites. If you notice this issue on other sites as well, please add a comment to this bug so that we can make an informed decision about whether to change our behavior. Thanks again.
Jul 31 2012,
To mmenke: Thanks for your comment, I missed the extra colon by an oversight. That download works well in IE and Firefox with the extra colon, so I thought it was a bug. That is my mistake. Thank you again.
Mar 10 2013,
May 14 2014,
I can confirm that Chrome (34, Windows 8 x64) still sends the wrong mime type. The RFC (http://tools.ietf.org/html/rfc4180) specifies text/csv but Chrome sends application/vnd.ms-excel instead.
Nov 29 2014,
I am having this issue, but it appears to be the same in firefox. This may be a window issue and not a chrome issue?
Jan 12 2015,
Mar 31 2015,
FWIW, Chrome 41 still sends application/vnd.ms-excel
Jun 24 2015,
Did anyone found a resolution to this? I am having the same issue.
Jul 6 2015,
It is possible to work around this by editing [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.csv\Content Type] and changing it to text/csv
Jul 9 2015,
Thanks cgrady! Sounds like Chrome is pulling the mime type from the registry. cgrady and others who are encountering this issue, what mime types do IE and Firefox send in this case?
Aug 11 2015,
IE, Firefox and Chrome all upload as Content-Type: application/vnd.ms-excel
Dec 7 2016,
Update to this, Firefox 50.0.2 reports the file as text/csv, which is correct. Edge and Chrome 54.0.2840.99 report as application/vnd.ms-excel, which should only be used for .xls or similar files as far as I am aware.
Jan 9 2018,
Presumably, to "fix" this, we'd just add CSV as a primary MIME mapping to the list in https://cs.chromium.org/chromium/src/net/base/mime_util.cc?l=78&rcl=8657d50e4244d0c3824aa2346a5230319bb24751; this list is consulted *before* looking at the file extension list in the Windows registry. Doing so would impact the MIME type if sniffing got involved in other codepaths (e.g. file download). Having said that, I'm unconvinced that this is something we really need to do. On Windows 10 without Office installed (such that the CSV extension does not have a Content-Type specified in the registry), Chrome, Edge, Firefox and IE all upload with the type application/octet-stream. Resetting triage flag, as I don't think the current owner has any plans of moving this forward.
Jan 16 2018,
I'm going to shift this to "Available" to get it off the net bug triager's radar--it sounds like the problem is understood but isn't currently high priority to fix.
I can confirm that email@example.com is right. Without MS Office installed al is OK and with "text/csv" becomes "application/vnd.ms-excel" would be nice to get some workaround to overcome that.. and somehow report this issue to MS..
also I have found this this https://answers.microsoft.com/en-us/msoffice/forum/msoffice_outlook/users-unable-to-open-attachments-even-after/3f326c89-6aec-49c5-9428-5160343d2450 but they did not got real issue behind that
Issue 862565 has been merged into this issue.
Sign in to add a comment