WordPress:“抱歉,出于安全原因,不允许使用此文件类型";尝试上传标准图像文件时 [英] Wordpress: "Sorry, this file type is not permitted for security reasons" when trying to upload standard image files
问题描述
有人知道任何解决方法吗?
Does anyone know of any workaround for this?
我正在尝试上载.jpg和.png文件,这是标准Wordpress设置中允许的两种文件类型,但出现上述错误.
I'm trying to upload .jpg and .png files, both file types allowed in standard Wordpress settings, but I get the above error.
到目前为止,我在Google上搜索的变通办法无法正常工作,因为Wordpress不再将我上传的文件视为图像.这些是插件:禁用Real Mime Check,以及允许在functions.php文件中未经过滤上传的代码变体.
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.
有什么建议吗?
推荐答案
您可以尝试编辑wp-config.php文件并添加;
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.
这篇关于WordPress:“抱歉,出于安全原因,不允许使用此文件类型";尝试上传标准图像文件时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!