For PHP < 5.5:
<?php
if (!function_exists('curl_file_create')) {
function curl_file_create($filename, $mimetype = '', $postname = '') {
return "@$filename;filename="
. ($postname ?: basename($filename))
. ($mimetype ? ";type=$mimetype" : '');
}
}
?>
转载于:https://my.oschina.net/swchenyuzhe/blog/374353