We use cookies
We use cookies to optimize our website. By continuing to browse the site, you agree to our use of cookies.
Control panel
  • Русский
  • Українська
  • English
  • UAH
  • USD
  • RUB
  • EUR
  • 0-800-307-307 Hotline
  • +38 (044) 392-74-33 Kiev
  • +38 (057) 728-39-00 Kharkiv
  • +38 (056) 794-38-31 Dnipro
  • +38 (032) 229-58-93 Lviv
  • +38 (048) 738-57-70 Odessa
  • +38(093) 170-15-42  Life
  • +38 (067) 400-88-44 Kievstar
  • +1(888)393-24-51  USA, Toll free
  • +44(131)507-01-14  Great Britain
  • +7 (499) 348-28-61 Moscow

2.13.1.1.10. The file type is invalid for security reasons

WordPress only supports uploading certain file types. When uploading an unsupported file type, the error “Sorry, this file type is invalid for security reasons". For the upload to be successful, either add the MIME type of the uploaded file to the list of supported ones, or disable type checking on upload.

Install a specialized plugin like WP Add Mime Types, and use it to add the desired MIME type to the list of allowed.

For example, to allow uploading CSV files, add the following line in the plugin settings:

CSV = text/csv

Add to file functions.php active theme is a block of code with the following content:

function additional_mime_types($mimes) {
 
    // новые MIME-типы, которые нужно разрешить
    $mimes['csv'] = 'text/csv';
    $mimes['doc']  = 'application/msword'; 
 
    return $mimes;
}
add_filter('upload_mimes', 'additional_mime_types');

In the body of the function additional_mime_types add the lines with the MIME types you need by analogy with those indicated in the example csv and doc.

To turn off the type checking of uploaded files, add at the beginning site config file (right after <?php) a line like this:

define('ALLOW_UNFILTERED_UPLOADS', true);