Wordpress: “Sorry, this file type is not permitted

2019-09-20 09:48发布

问题:

Does anyone know of any workaround for this?

I'm trying to upload .jpg and .png files, both file types allowed in standard Wordpress settings, but I get the above error.

The workarounds I've googled so far don't work as Wordpress no longer sees the files i'm uploading as images. These are the plugin: Disable Real Mime Check, and variations of code that allow unfiltered uploads in the functions.php file.

I'm sometimes able to get my images uploaded but mostly not, and I can't see a pattern to which images get uploaded and which don't.

Any advice?

回答1:

You can try editing the wp-config.php file and adding in;

define(‘ALLOW_UNFILTERED_UPLOADS’, true);

This will allow you to then upload forbidden files, however as a precaution once uploaded I would delete this edit.