Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在WordPress网站上传.exe文件_Wordpress - Fatal编程技术网

在WordPress网站上传.exe文件

在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

我需要在我的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 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做得很好