[wp-trac] [WordPress Trac] #39550: Some Non-image files fail to upload after 4.7.1

WordPress Trac noreply at wordpress.org
Fri Jan 13 17:32:45 UTC 2017


#39550: Some Non-image files fail to upload after 4.7.1
---------------------------+------------------------
 Reporter:  greatislander  |       Owner:  joemcgill
     Type:  defect (bug)   |      Status:  assigned
 Priority:  normal         |   Milestone:  4.7.2
Component:  Upload         |     Version:  trunk
 Severity:  normal         |  Resolution:
 Keywords:  needs-patch    |     Focuses:
---------------------------+------------------------

Comment (by Ipstenu):

 FWIW, it's not setting the 'wrong' mime-type, it's setting a perfectly
 valid and acceptable mime-type.

 There can be multiple acceptable mime types, as it turns out (that was
 when I started bashing my head into my desk, for the record).

 The array idea @mensmaximus pitched is a good idea I think, but we have to
 make sure it'll support the existing way of adding new mimes to the okay
 list.

 I mentioned in slack yesterday but here for posterity:

 > FWIW, I was testing with various things and trying to figure out why
 _some_ files worked and others didn't. Using `file -I` on my mac, I
 determined that if the filetype didn't match what we had in
 `wp_get_mime_types` it failed.  In the case of the test.csv in the ticket,
 it comes back as `text/plain` - which is actually a valid mime type for
 CSV files (along with 9 others, depending on the OS/browser/app). It's the
 same reason the docx file in the ticket fails. It comes back as
 `application/octet-stream; charset=binary` and we're looking for
 `application/vnd.openxmlformats-officedocument.wordprocessingml.document`

--
Ticket URL: <https://core.trac.wordpress.org/ticket/39550#comment:44>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list