public static function File($filename, $mimetype = '', $postname = '')
    {
        if (class_exists('CURLFile')) {
            return new \CURLFile($filename, $mimetype, $postname);
        }

        if (function_exists('curl_file_create')) {
            return curl_file_create($filename, $mimetype, $postname);
        }

        return sprintf('@%s;filename=%s;type=%s', $filename, $postname ?: basename($filename), $mimetype);
    }
public static function File($filename, $mimetype = '', $postname = '')
    {
        if (class_exists('CURLFile')) {
            return new \CURLFile($filename, $mimetype, $postname);
        }

        if (function_exists('curl_file_create')) {
            return curl_file_create($filename, $mimetype, $postname);
        }

        return sprintf('@%s;filename=%s;type=%s', $filename, $postname ?: basename($filename), $mimetype);
    }
public static function File ( $ filename , $ mimetype = '' , $ postname = '' ) { if ( class_exists ( 'CURLFile' ) ) { return new \ CURLFile ( $ filename , $ mimetype , $ postname ) ; } if ( function_exists ( 'curl_file_create' ) ) { return curl_file_create ( $ filename , $ mimetype , $ postname ) ; } return sprintf ( '@%s;filename=%s;type=%s' , $ filename , $ postname ? : basename ( $ filename ) , $ mimetype ) ; }
Prepares a file for upload. To be used inside the parameters declaration for a request.
@param string $filename The file path
@param string $mimetype MIME type
@param string $postname the file name
@return string|\CURLFile
Prepares a file for upload . To be used inside the parameters declaration for a request .