Cloud Service >> Knowledgebase >> WordPress >> How to Fix “Not Allowed to Upload this File Type”| Error in WordPress
submit query

Cut Hosting Costs! Submit Query Today!

How to Fix “Not Allowed to Upload this File Type”| Error in WordPress

Are you a WordPress user stuck with a chatty message stating, "Sorry, this file type is not allowed for upload processing"? You're not alone. This widespread problem, as a rule, can happen for different reasons and, as a result, makes analytics people totally bored, making them scratch their heads in astonishment. But I'm sure you do, therefore, we will guide you through the steps to resolve the problem. After that, everything will be fine, and you will be able to upload your files in the desired format without any problem.

Error in WordPress

Furthermore, do not forget that the reason for the error should be understood before addressing a solution. Now, WordPress has incorporated protection against any dangerous file format that cannot be uploaded to your site. On the one hand, it helps to prevent your writing from being hacked; however, it has a propensity to trigger false positives, blocking legitimate file types that you actually want to upload.

All right, and on to the solution for you. Follow these steps to fix the "Sorry, you are not allowed to upload this file type" error in WordPress: 

Step 1: Identify the File Type

The first task is to determine the file type that serves as the input. While loading a file and getting an error message, pay attention to the file extension (say .exe). . ., for that will help to solve the problem.

Step 2: Update WordPress and Plugins

Plugins, as well as the core file of WordPress, become outdated and sometimes can cause problems in compatibility to cause writing such types of error messages you are probably receiving. First, open the "Updates" page on the WordPress dashboard and tap any walkthrough if you are presented with any updates. Then carefully follow the instructions on how to make your WordPress installation and all your active add-ons current.

Step 3: Check File Permissions

Another reason for the "Sorry, you are not allowed to upload this file type" problem might be incorrect file permissions on your server. Use the file manager provided by your hosting company or FTP to connect to your website, then locate the wp-content directory. Verify the uploads folder's permissions; they should normally be set to 755 or 750. If not, make the necessary adjustments.

Step 4: Edit functions.php File

Should the aforementioned measures prove ineffective, consider incorporating personalized code into the functions.php file of your theme to permit the uploading of particular file kinds. Go to the wp-content/themes/your-theme-name directory, open the functions.php file for your theme, and add the following code snippet:

php

function custom_upload_mimes( $existing_mimes ) {

    // Add support for SVG files

    $existing_mimes['svg'] = 'image/svg+xml';

    return $existing_mimes;

}

add_filter( 'upload_mimes', 'custom_upload_mimes' );

Replace 'svg' with the file extension causing the error. Save the changes and upload the modified functions.php file back to your server. Be sure to use a child theme or a custom plugin for making code modifications to prevent them from being overwritten during theme updates.

Step 5: Install a Plugin

If you're not comfortable editing code, you can use a plugin to manage file upload permissions. Install and activate a plugin like "WP Add Mime Types" or "Disable Real MIME Check" from the WordPress plugin repository. These plugins allow you to add additional file types or bypass MIME type checks easily.

Step 6: Contact Your Hosting Provider

If these trio did not work, it is unlikely that the error is because your host is set on to server-level policies which could be restricting access. Get hold of your hosting provider's support department and let them know the issue. In addition to making sure that the desired features are set up on your machine they should be able to help you resolve any server-side problems that are flagged up.

You can fix this problem by taking these steps and then will no longer see this error "Sorry, you are not allowed to upload this file type ". While poking into the core files or installing plugins, make sure always to be watchful and don’t forget to use backups to avoid any data loss. For more information-get in touch with hosting experts

Cut Hosting Costs! Submit Query Today!

Grow With Us

Let’s talk about the future, and make it happen!