Did you recently try uploading a file on WordPress, and got an error which said: Sorry, this file type is not supported for security reasons? Well, you’re not alone. This is one of the most common errors users are confronted with. This is perhaps why we thought of writing this tutorial for you. In this WordPress tutorial, we will have an in-depth look on why Sorry, this file type is not permitted for security reasons error is thrown, and how to fix it.
Let’s get started.
What you’ll need
Before starting this tutorial, you’ll need the following:
Table of Contents
Why do you get this file type is not permitted for security reasons error?
Well, whenever you try to upload a file in a format different from the formats allowed, you are bound to get this error. By default, WordPress allows you to upload images in .gif, .png, .jpg and .jpeg formats; documents in .xls and .xlsx, .pdf, .ppt, .pptx, .pps and .ppsx, .doc and .docx, and .odt formats; audio in .flv, .mp3, .m4v, .wma, .m4a, .mid, .ogg, .mp4, .wma and .mid formats and videos in .ogv, .mp4, .3gp, .m4v, .avi, .mov, .3g2, .webm, .wmv and .mpg formats. In addition, other file formats like .zip and .key are also allowed. Thus, whenever you try uploading a file in a format that is different than those specified above, WordPress throws an error. Now, let’s have a quick look on how this can be fixed.
Fixing Sorry, This File Type Is Not Supported For Security Reasons Error
Using a WordPress plugin
You can easily fix the error using WordPress plugins. There are various plugins which you can use. For example Pro Mime Types. The best part about this plugin is its ability to work for both single and multisite.
All you need to do is:
- Install the plugin and activate it.
- Navigate to Setttings -> Mime Type Settings.
- Now you need to add mime type value for the file extension you want to upload. You can find almost all mime types here. Mime type should be added in a specific format. For example, in order to allow upload of .abiword files, you need to add the following line:
Once you are done, press Save button. New mime type will appear at the bottom of the list, in red.
By editing wp-config.php file
If the above plugins don’t work for you, you can also edit wp-config.php file and allow it to upload all file extensions.
IMPORTANT: It’s not a recommended method as it will make your WordPress less secure. Once you have uploaded the file, be sure to revert changes made to wp-config.php file.
All you need to do is:
- Connect to your website using an FTP client or File Manager.
- Access the WordPress installation directory and look for wp-config.php file. Open it for editing.
- Paste the following line of code anywhere above the line that says ‘That’s all, stop editing! Happy blogging’:
Contacting your hosting provider
If you have already tried all of the above-mentioned steps, and nothing seems to work, it might be the right time to contact your hosting provider. At times, hosting providers restrict certain file formats to ensure security, and they will be able to guide you better through this. If you are a Hostinger client, contact customer success team via live chat and they will gladly help you.
Sorry, this file type is not supported due to security reasons error might be troublesome at times. But, you can always fix it by following the steps given above. We hope that the above-mentioned tutorial was easy to follow and will successfully guide you throughout the process.