Allowing all/different file type uploads

I’ve looked through a number of previously accepted answers, but none seem to work/apply to the latest versions of WordPress.

I’m trying to allow .rfa file types to be uploaded to the media library.

This is what I’ve found from a previous answer;

function additional_mime_types($mime_types) {
  $mime_types['rfa'] = 'application/octet-stream';
  return $mime_types;
}
add_filter('upload_mimes', 'additional_mime_types', 1, 1);

How can I allow .rfa file types to be uploaded to the media library?

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

I had the same issue, it looks like WordPress isn’t able to determine the correct MIME type for RFA files, so it defaults to:

'application/CDFV2-unknown'

Changing the MIME type to this fixed it for me. So it would be:

add_filter( 'upload_mimes', function ( $mime_types ) {
    $mime_types['rfa'] = 'application/CDFV2-unknown';
    return $mime_types;
} );


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x