protected function createCurlFile($filename, $mimetype = '', $postname = '')
    {
        if (!function_exists('curl_file_create')) {
            // For PHP < 5.5
            return "@$filename;filename="
                .($postname ?: basename($filename))
                .($mimetype ? ";type=$mimetype" : '');
        }

        // For PHP >= 5.5
        return curl_file_create($filename, $mimetype, $postname);
    }
protected function createCurlFile($filename, $mimetype = '', $postname = '')
    {
        if (!function_exists('curl_file_create')) {
            // For PHP < 5.5
            return "@$filename;filename="
                .($postname ?: basename($filename))
                .($mimetype ? ";type=$mimetype" : '');
        }

        // For PHP >= 5.5
        return curl_file_create($filename, $mimetype, $postname);
    }
protected function createCurlFile ( $ filename , $ mimetype = '' , $ postname = '' ) { if ( ! function_exists ( 'curl_file_create' ) ) { // For PHP < 5.5 return "@$filename;filename=" . ( $ postname ? : basename ( $ filename ) ) . ( $ mimetype ? ";type=$mimetype" : '' ) ; } // For PHP >= 5.5 return curl_file_create ( $ filename , $ mimetype , $ postname ) ; }
Build the CURL file based on PHP version

@param  string $filename
@param  string $mimetype
@param  string $postname

@return string|\CURLFile
Build the CURL file based on PHP version