callmez\wechat\sdk\Wechat::uploadShopImage PHP Method

uploadShopImage() public method

上传图片(小店接口)
public uploadShopImage ( $filePath, null $fileName = null ) : boolean
$filePath 文件完整路径
$fileName null 文件名 如不填写.则使用文件路径里的名称
return boolean
    public function uploadShopImage($filePath, $fileName = null)
    {
        $fileName === null && ($fileName = pathinfo($filePath, PATHINFO_BASENAME));
        $result = $this->httpRaw(self::WECHAT_SHOP_IMAGE_UPLOAD_URL . 'access_token=' . $this->getAccessToken() . '&filename=' . $fileName, file_get_contents($filePath));
        return isset($result['errmsg']) && $result['errmsg'] == 'success' ? $result['image_url'] : false;
    }
Wechat