Home  >  Article  >  Backend Development  >  Post error occurred: error code 40005, WeChat returned error message: invalid file type, 40005invalid_PHP tutorial

Post error occurred: error code 40005, WeChat returned error message: invalid file type, 40005invalid_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 09:47:181621browse

A Post error occurred: error code 40005, WeChat returned error message: invalid file type, 40005invalid

When deploying PxxCms to customers, when using the group sending function to send images and texts, the following prompts: A Post error occurred: error code 40005, WeChat returned error message: invalid file type, I have never learned PHP and cannot afford to hurt...

Google went to a certain brother’s blog, there is a solution, but tmd charges... I deleted it and changed it myself

Find the sendAll method of PigCmsLibActionUserMessageAction.class.php, about line 112, change it to the following, comment out the first line 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>

You should understand the reason by looking at the code.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1026886.htmlTechArticleA Post error occurred: error code 40005, WeChat returned error message: invalid file type, 40005invalid Deploy PxxCms to customers, When using the group sending function to send pictures and texts, it prompts: P...
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