IIS下wordpress上传文件-从服务器收到预料之外的响应
上传小文件可以正常上传,但上传大文件时,如大于30M左右,就会出错,显示
从服务器收到预料之外的响应,此文件可能已被成功上传。请检查媒体库或刷新本页
由于,我的WordPress部署在IIS下,所以网上查找的关于Nginx下面的错误原因,都不适用。
我已在另一遍文章中
介绍了如何修改wordpress和php中的文件上传大小限制,因此,问题肯定出在IIS中。
具体操作方法如下:
先从整个站点的配置开始
![](https://tiantai.live/wp-content/uploads/2022/03/3b3234a5bd5c877807e165d605ef156c_1477347828.png)
![](https://tiantai.live/wp-content/uploads/2022/03/3b3234a5bd5c877807e165d605ef156c_1477381937.png)
![](https://tiantai.live/wp-content/uploads/2022/03/3b3234a5bd5c877807e165d605ef156c_1477404937.png)
![](https://tiantai.live/wp-content/uploads/2022/03/3b3234a5bd5c877807e165d605ef156c_em19.gif)
然后,同样的配置在指定的网站下操作
![](https://tiantai.live/wp-content/uploads/2022/03/3b3234a5bd5c877807e165d605ef156c_1477544046.png)
![](https://tiantai.live/wp-content/uploads/2022/03/3b3234a5bd5c877807e165d605ef156c_em19.gif)
设置完后,上传大文件成功
另外,顺便说一下Linux下使用Nginx碰到此问题的解决方法:
同样的原理,主要是修改Web服务器的上传文件大小限制
打开Nginx的配置文件,修改或添加:client_max_body_size xxM;如:
![](https://tiantai.live/wp-content/uploads/2022/03/3b3234a5bd5c877807e165d605ef156c_1477822359.png)