if (class_exists('\CURLFile')) {
$field = array('fieldname' => new \CURLFile(realpath($filepath)));
curl_setopt($ch, CURLOPT_SAFE_UPLOAD, true);
} else {
$field = array('fieldname' => '@' . realpath($filepath));
curl_setopt($ch, CURLOPT_SAFE_UPLOAD, false);
}
php文件上传到远程服务器
猜你喜欢
转载自my.oschina.net/u/232595/blog/1822750
今日推荐
周排行