请教一个关于用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新手入门必备之书是what? PHP获取路径问题 求JS与PHP高手帮帮忙....。。。。。。。。。. sql查询菜鸟问题 关于str_replace,字符串变量可以替换,从数据库读出来就不行,请大家帮忙看看,急 多谢!!! 在CMD下如何运行PHP程序 smarttemplate具体应用 关于session_save_path,试不出来的问题,请大家帮忙,谢谢. 有没有能够显示某个QQ号是否在线的程序? php中如何对输出的文章限制字数,剩余的用“...”表示? 有没有占资源少一点的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);
?>