input license here

Hướng dẫn fix lỗi “Sorry, This File Type Is Not Permitted For Security Reasons” cho server -


Each host will support certain uploadable file types. When you get the error “Sorry, This File Type Is Not Permitted For Security Reasons” it means the file type you uploaded is not supported


This can be very annoying, but from now on you will not need to worry much anymore. By showing such error is to save files and folders from any kind of malicious files. Sometimes attackers will use different file types including a malicious script or something similar to hack a website.


Error fix method


Usually there will be 3 basic ways, but you can shorten it to two ways. Below are the details of these methods.


Method 1: Edit file wp-config.php


Before changing anything, there is a small suggestion that you should revert the changes after uploading the file you want.


Here are the steps:



  • Open your cPAnel hosting account and find the management file


How to Fix ‘Sorry, This File Type Is Not Permitted For Security Reasons’ For a Website’s Server



  • From the left sidebar, click on the public_html entry and then find the wp-config.php file. Don't confuse them with folders. These files are visible at the bottom


How to Fix ‘Sorry, This File Type Is Not Permitted For Security Reasons’ For a Website’s Server



  • Right click and select “Edit”

  • Then click “Edit” on the popup screen


How to Fix ‘Sorry, This File Type Is Not Permitted For Security Reasons’ For a Website’s Server



  • You will see a new tab with the code of wp-config.php file. Here is the line of code that you must add:


define('ALLOW_UNFILTERED_UPLOADS', true);

Note: Add this line above “That's all, stop editing! Happy publishing”


From the top right corner, don't forget to click save changes!


Method 2: edit the file functions.php


The functions.php file controls every feature of a WordPress website. You can edit existing features or add a new feature.


Here are the steps to take:



  • Once you have the public_html directory, open the WP-CONTENT folder with all the themes, plugins and media files.

  • Click on the theme folder you are using, You may have installed many themes, but you have to edit the active theme file

  • Scroll down to find the functions.php file and right click to edit

  • On the new tab, here are some code requirements that you can add:


function my_custom_mime_types( $mimes ) {
   // Add new MIME types here
   $mimes['abiword'] = 'application/x-abiword';
   return $mimes;
}
add_filter( 'upload_mimes', 'my_custom_mime_types' );

Remember, don't forget to save it there ^^!


The third method is to connect your hosting customer support. Sometimes the hosting company won't let you add code to edit wp-config.php or functions.php


In such a case, only your web hosting customer support representative can help you. Nowadays, most companies offer to use live chat or email ticket


You should be careful while editing files to upload unsupported files. Whether you use wp-config.php or functions.php, remove the code immediately after uploading the file. Whether you use wp-config.php or functions.php, delete the code only after the file has been uploaded!


BKNS is sure that you will not want to have any problems that harm your website. Through the instructions above, have you seen how to fix the "Sorry, This File Type Is Not Permitted For Security Reasons" error for the website's server to become easier? Thank you for reading the article. Wishing you health and success. Please stop by BKNS when you need any help related to our current field!


Related Posts
Diệp Quân
Nguyen Manh Cuong is the author and founder of the vmwareplayerfree blog. With over 14 years of experience in Online Marketing, he now runs a number of successful websites, and occasionally shares his experience & knowledge on this blog.
SHARE

Related Posts

Subscribe to get free updates

إرسال تعليق

Sticky