How to fix ‘Sorry, this file type is not permitted for security reasons.’ in WordPress

Overview

In this Scenario We are looking the most common error that can be occur when we are uploading / importing the media and it getting error “Sorry, this file type is not permitted for security reasons” . Its getting because the WordPress has some limits/ restriction on uploading / importing media for our safe browsing internet.

Why is it getting “Sorry, this file type is not permitted for security reasons.” error ?

WordPress have followed the standard security policy. That’s why it implement some limits on uploads / import media otherwise suspicious user could upload the malware file & get benefits from them. if we take example, Suppose, we are enable the unfiltered uploading / importing media on the other hand attacker could upload the malware files on to them and take access on it, either he/she demands ransomware, So there are lots of things that could be happen. if WordPress unfiltered options enable it by default.

WordPress allowing the common using extensions it can helps to upload images, documents, audio, video apart of them other extension are blocked for security reason. it will help you to protect unwanted uploading from suspicious user.

By default enable extensions in WordPress

Images

.jpg
.jpeg
.png
.gif
.webp

Documents

.pdf (Portable Document Format; Adobe Acrobat)
.doc, .docx (Microsoft Word Document)
.odt (OpenDocument Text Document)
.xls, .xlsx (Microsoft Excel Document)
.key (Apple Keynote Presentation)
.ppt, .pptx, .pps, .ppsx (Microsoft PowerPoint Presentation)

Audio

.mp3
.m4a (might not work in all browsers)
.ogg
.wav

Video

.mp4, .m4v (MPEG-4)
.mov (QuickTime)
.wmv (Windows Media Video)
.avi
.mpg
.ogv (Ogg)
.3gp (3GPP)
.3g2 (3GPP2)

Why we are enabling it?

Sometimes we make our work easy and reliable. So, we want to upload other extension that are not include in default extension in WordPress. In this scenario we are modifying our woo-commerce product so firstly we are exported all product and when we are upload the csv file but it getting “Sorry, this file type is not permitted for security reasons” error, So if we are not enable it then we will make it manually and it taking too much time compare to updating through importing options.

How to enable it & Disable it ?

Go to the WordPress root directory and find the “wp-config.php” file open in editor mode and add a line at bottom then save it. After your job is complete don’t forget to disable it. To disable it you can remove the code line and you can also make false instead of true.

define('ALLOW_UNFILTERED_UPLOADS', true);

Now you are able to all types of extension upload / import on to the database easily.

We have successfully import 29 products. I hope this article will help you.

1 Shares:
Leave a Reply

Your email address will not be published. Required fields are marked *

You May Also Like