Make WordPress Core

Opened 5 years ago

Closed 3 years ago

#14659 closed defect (bug) (fixed)

Incorrect mime type served for some uploaded files

Reported by: recoilfx Owned by: markjaquith
Milestone: 3.6 Priority: normal
Severity: normal Version: 3.0.1
Component: Upload Keywords: has-patch commit
Focuses: Cc:


I used "upload_mimes" filter so that I can add additional allowed upload files types, however, there is a problem when serving these files.

It seems that ms-files.php does a short init, which skips the plugin files that registers the additional mime definitions.

So if I am trying to serve a Mathematica .nb file(which has the mime type application/mathematica, but it really is a text file), the file will be either served as a mime type of text (if mime_content_type exists) or image instead of the proper 'application/mathematica'.

Attachments (1)

webm.diff (413 bytes) - added by wonderboymusic 3 years ago.

Download all attachments as: .zip

Change History (13)

comment:1 @recoilfx5 years ago

  • Summary changed from Incorrect mime type served for some uploaded file to Incorrect mime type served for some uploaded files

comment:2 @hakre5 years ago

  • Component changed from General to Multisite

Since shortinit was new to 3.0 I assume that this is a multisite related issue.

comment:3 @mdawaffe5 years ago

  • Keywords close 2nd-opinion added
  • Milestone changed from Awaiting Review to Future Release

The SHORTINIT and it's limitations are intentional.

This should probably be documented as a good use case for sunrise.php.

comment:4 @ocean904 years ago

  • Keywords dev-feedback added; mime upload close 2nd-opinion removed

Related: #20136

@wonderboymusic3 years ago

comment:5 @wonderboymusic3 years ago

  • Keywords has-patch added; dev-feedback removed

ms-files is gone / going-away by default in 3.5, but .webm files should be in the allowed mime types list. .ogv is in there, webm should be too

About WebM:

Patch attached

comment:6 @wonderboymusic3 years ago

#20136 was marked as a duplicate.

comment:7 @DrewAPicture3 years ago

+1 for adding .webm

comment:8 @nacin3 years ago

  • Component changed from Multisite to Upload
  • Keywords commit added
  • Milestone changed from Future Release to 3.5

comment:9 @nacin3 years ago

  • Milestone changed from 3.5 to Future Release

Did not mean to assign this to 3.5.

comment:10 @mcepl3 years ago

  • Cc mcepl added

comment:11 @markjaquith3 years ago

  • Milestone changed from Future Release to 3.6

comment:12 @markjaquith3 years ago

  • Owner set to markjaquith
  • Resolution set to fixed
  • Status changed from new to closed

In 23229:

Add .webm (video/webm) to wp_get_mime_types(). props wonderboymusic. fixes #14659

Note: See TracTickets for help on using tickets.