I created login using cURL to this site "https://svn.logicgenie.com:8090/svn/" and displayed only file names in it. Now i need to download particular file from SVN. How can i do that? Please help me with the codes.
I used this cURL Script:
$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');
The url used, to download file is "https://svn.logicgenie.com:8090/svn/cheapssls/trunk/admin.php". Only the file name "admin.php" is getting open. It is not working with some other file name or link . What would be the problem? Please do help me.