2.14.1.1.10. File type is not allowed for security reasons
WordPress supports uploading only specific file types. When you upload a file of an unsupported type, error "Sorry, this file type is not permitted for security reasons" may occur. For successful upload, you must either add the MIME type of the uploaded file to supported types list or disable type checking during upload.
Add new types using plugins
Install a specialized plugin such as WP Add Mime Types and use it to add the required MIME type to the allowed list.
For example, to allow CSV file upload, you need to add this line in plugin settings:
CSV = text/csv
Add new types using functions.php
Add to functions.php file of active theme a code block with this content:
function additional_mime_types($mimes) {
// new MIME types to allow
$mimes['csv'] = 'text/csv';
$mimes['doc'] = 'application/msword';
return $mimes;
}
add_filter('upload_mimes', 'additional_mime_types');
In additional_mime_types function body, add lines with required MIME types by analogy with csv and doc example.
Disable type checking
To disable uploaded file type validation, add this line at the beginning of site configuration file (right after <?php):
define('ALLOW_UNFILTERED_UPLOADS', true);