$url = 'http://example.com/someLARGE.file';
$path = 'test.txt';
$fp = fopen($path, 'w+');
$curl = curl_init();
//curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_FILE, $fp);
curl_setopt ($curl, CURLOPT_URL, $url);
curl_exec($curl);
curl_close($curl);
fclose($fp);
輸出被寫入到瀏覽器,而不是服務器:(
你能否確認你可以寫入$ path - curl並不總是在無效文件句柄上報告錯誤 – ejrowley 2011-05-27 09:07:09
權限被拒絕。 – 2011-05-27 09:50:39
@jrowley,你可以發表一個問題,我可以接受嗎? – 2011-05-27 09:51:02