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

WordPress Trac noreply at wordpress.org
Sat Mar 11 00:23:40 UTC 2017


#39550: Some Non-image files fail to upload after 4.7.1
---------------------------+------------------------
 Reporter:  greatislander  |       Owner:  joemcgill
     Type:  defect (bug)   |      Status:  closed
 Priority:  normal         |   Milestone:  4.7.3
Component:  Upload         |     Version:  4.7.1
 Severity:  critical       |  Resolution:  fixed
 Keywords:  fixed-major    |     Focuses:
---------------------------+------------------------

Comment (by imelgrat):

 Replying to [comment:137 blobfolio]:

 Hello blobfolio:

 I just wanted to thank you for the snippet. Changing the MIME type for OGV
 files to video/ogg instead of application/ogg did the trick. I can now
 upload OGV files both in Linux and Windows setups. Anyone having trouble
 with OGV file uploads should try this.


 >
 > If you have a custom theme on your site, adding the following to its
 `functions.php` should fix it:
 > {{{#!php
 > function ogx_upload_mimes( $existing_mimes = array() ) {
 >       $existing_mimes['ogx'] = 'application/ogg';
 >       $existing_mimes['ogv'] = 'video/ogg';
 >       return $existing_mimes;
 > }
 > add_filter( 'upload_mimes', 'ogx_upload_mimes' );
 > }}}

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


More information about the wp-trac mailing list