0
我使用cURL登錄到本網站「https://svn.logicgenie.com:8090/svn/」,並僅顯示文件名。現在我需要從SVN下載特定的文件。我怎樣才能做到這一點?請幫我編碼。如何使用cURL PHP在Laravel Framework中從svn(https站點)下載文件?
我用這個捲曲腳本:
$url = "https://svn.logicgenie.com:8090/svn/cheapssls/trunk/admin.php";
set_time_limit(0);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_USERPWD, "firstuser:welcome");
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$r = curl_exec($ch);
echo $r;
curl_close($ch);
header('Expires: 0'); // no cache
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s', time()) . ' GMT');
header('Cache-Control: private', false);
header('Content-Type: application/force-download');
header('Content-Disposition: attachment; filename="' . basename($url) . '"');
header('Content-Transfer-Encoding: binary');
header('Content-Length: ' . strlen($r)); // provide file size
header('Connection: close');
使用的URL,下載文件是 「https://svn.logicgenie.com:8090/svn/cheapssls/trunk/admin.php」。只有文件名「admin.php」正在打開。它不適用於其他文件名或鏈接。會有什麼問題?請幫助我。
我試圖使用cURL PHP代碼從svn倉庫下載文件。這裏的命令是什麼?我在哪裏放?幫助我的PHP代碼。 – 2014-12-04 06:20:48