请教一个关于用cURL实现文件上传的问题? 问题如题目,请大家帮忙解决下,我是刚刚开始学cURL的.最好能带上测试案例附加源码!!谢谢!!!! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 http://curl.haxx.se/libcurl/c/post-callback.html这里有一个现成的教程,自己用google翻译一下。 额,我需要一个PHP版的!那个C版的看的比较艰难 <?php $ch = curl_init(); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_VERBOSE, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible;)"); curl_setopt($ch, CURLOPT_URL, _VIRUS_SCAN_URL); curl_setopt($ch, CURLOPT_POST, true); // same as <input type="file" name="file_box"> $post = array( "file_box"=>"@/path/to/myfile.jpg", ); curl_setopt($ch, CURLOPT_POSTFIELDS, $post); $response = curl_exec($ch);?> php如何对数据进行批量修改? 进入mydql创建数据库提示下面错误(如图) 超级郁闷的十一 PHP截取从数据库中读出的数据 [请教]如何在php中实现类似include()的功能 利用sendmail发mail时"发信人"能不能不显示本机的名字? 请教一个问题 关于LDAP的PHP编程,请高手指教! 在php界面select下拉框出不来 php中 for循环的写法 有没有占资源少一点的IDE MAC下的xampp mysql的安装路径
这里有一个现成的教程,自己用google翻译一下。
额,我需要一个PHP版的!那个C版的看的比较艰难
$ch = curl_init();
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_VERBOSE, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible;)");
curl_setopt($ch, CURLOPT_URL, _VIRUS_SCAN_URL);
curl_setopt($ch, CURLOPT_POST, true);
// same as <input type="file" name="file_box">
$post = array(
"file_box"=>"@/path/to/myfile.jpg",
);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
$response = curl_exec($ch);
?>