Home  >  Article  >  php教程  >  发生了Post错误:错误代码40005,微信返回错误信息:invalid file type,40005invalid

发生了Post错误:错误代码40005,微信返回错误信息:invalid file type,40005invalid

WBOY
WBOYOriginal
2016-06-13 08:58:441776browse

发生了Post错误:错误代码40005,微信返回错误信息:invalid file type,40005invalid

给客户部署 PxxCms, 使用群发功能发送图文的的时候提示: 发生了Post错误:错误代码40005,微信返回错误信息:invalid file type, 没学过php伤不起 ...

Google 到某哥的博客, 有解决方案, 但是tmd 收费...擦了, 自己改

找到 \PigCms\Lib\Action\User\MessageAction.class.php 的 sendAll 方法, 大约112 行, 改成如下,注释掉第一行file_put_contents(...);

//file_put_contents(CONF_PATH.<span>'</span><span>img_</span><span>'</span>.$img[<span>'</span><span>id</span><span>'</span>].<span>'</span><span>.jpg</span><span>'</span>,file_get_contents($img[<span>'</span><span>pic</span><span>'</span><span>]));
$postMedia[</span><span>'</span><span>media</span><span>'</span>]=$_SERVER[<span>'</span><span>DOCUMENT_ROOT</span><span>'</span>].str_replace(<span>'</span><span>http://</span><span>'</span>.$_SERVER[<span>'</span><span>HTTP_HOST</span><span>'</span>],<span>''</span>,$img[<span>'</span><span>pic</span><span>'</span><span>]);</span>

原因看代码应该就理解了.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn