Wechat public platform programming, how to reply to a picture separately?

developed according to Wechat"s documentation, it has been unsuccessful

document: https://mp.weixin.qq.com/wiki.

    public function responseImage($postObj){
        $xmltpl = "<xml>
                    <ToUserName>< ![CDATA[%s] ]></ToUserName>
                    <FromUserName>< ![CDATA[%s] ]></FromUserName>
                    <CreateTime>%s</CreateTime>
                    <MsgType>< ![CDATA[image] ]></MsgType>
                    <Image>
                        <MediaId>< ![CDATA[%s] ]></MediaId>
                    </Image>
                </xml>";
        $result = sprintf($xmltpl, $postObj->FromUserName, $postObj->ToUserName,time(),$postObj->MediaId);
        return $result;
    }
$postObj = simplexml_load_string($postStr, "SimpleXMLElement", LIBXML_NOCDATA);

error after sending picture: the official account service failed

the reply of the text message is correct, but it is not good for a single picture, it is in encrypted mode.

Warriors, please take a look. Is there anything wrong and how to solve it?
Thank you

    public function responseText($postObj){
        //
        $content = $postObj -> Content;
        $xmltpl = "<xml>
                     <ToUserName><![CDATA[%s]]></ToUserName>
                     <FromUserName><![CDATA[%s]]></FromUserName>
                     <CreateTime>%s</CreateTime>
                     <MsgType><![CDATA[text]]></MsgType>
                     <Content><![CDATA[%s]]></Content>
                 </xml>";
        $result = sprintf($xmltpl, $postObj->FromUserName, $postObj->ToUserName, time(), $content);
        return $result;
    }

encryption code

       //
            if ($encrypt_type == "aes"){
                 $encryptMsg = ""; //
                 $errCode = $pc->encryptMsg($result, $timeStamp, $nonce, $encryptMsg);
                 $result = $encryptMsg;
            }
            echo $result;

this is a pit
xml template cannot have spaces, just clear it

the template given by Wechat's official document is available, but there is no prompt.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1ea3837-1c5d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1ea3837-1c5d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?