PFinal\Wechat\Support\Curl::file PHP Method

file() public static method

public static file ( $url, $field, $filename, $postData = [] )
    public static function file($url, $field, $filename, $postData = array())
    {
        $filename = realpath($filename);
        //PHP 5.6 禁用了 '@/path/filename' 语法上传文件
        if (class_exists('\\CURLFile')) {
            $postData[$field] = new \CURLFile($filename);
        } else {
            $postData[$field] = '@' . $filename;
        }
        return self::execute($url, 'post', $postData);
    }