How can I allow .bin files upload in media library?
I have found couple codes online but none of them actually work.
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It only takes a minute to sign up.
Sign up to join this communityThis code would allow you to upload .bin
files.
/**
* Allow upload bin mime type
*/
add_filter( 'upload_mimes', 'wpse_287673_allow_upload_bin_mime_type', 1, 1 );
function wpse_287673_allow_upload_bin_mime_type( $mime_types ) {
$mime_types['bin'] = 'application/octet-stream';
return $mime_types;
}
This code is tested and is working for me, but it might be some differences for you since we are allowing files to be uploaded by extension and mime type and mime type of your file is defined by webserver.