在WordPress网站上传.exe文件
我需要在我的wordpress网站上传.exe文件。我已经添加了define('ALLOW_unfilted_UPLOADS',true);在我的wp-config.php文件中,但仍然显示相同的错误。请帮忙。在WordPress网站上传.exe文件,wordpress,Wordpress,我需要在我的wordpress网站上传.exe文件。我已经添加了define('ALLOW_unfilted_UPLOADS',true);在我的wp-config.php文件中,但仍然显示相同的错误。请帮忙。 谢谢你的评论,下面的代码解决了我的问题 function enable_extended_upload ( $mime_types =array() ) { // The MIME types listed here will be allowed in the media li
谢谢你的评论,下面的代码解决了我的问题
function enable_extended_upload ( $mime_types =array() ) {
// The MIME types listed here will be allowed in the media library.
// You can add as many MIME types as you want.
$mime_types['exe'] = 'application/exe';
return $mime_types;
}
add_filter('upload_mimes', 'enable_extended_upload');
无论您试图通过允许EXE上传来解决什么问题,可能有一种更安全/更好的方法。请尝试以下回答:@user1751825设想我想编写一个程序,从我的WP网站下载安装程序。@EmilMocan我的用例比设置单独的服务器简单得多-可执行文件下载是全网的常见做法将此添加到my functions.php,用wordpress 5.2做得很好