api - How to download files from svn (https site) using cURL PHP in Laravel Framework? -
i created login using curl site "https://svn.logicgenie.com:8090/svn/" , displayed file names in it. need download particular file svn. how can that? please me codes.
i used 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, download file "https://svn.logicgenie.com:8090/svn/cheapssls/trunk/admin.php". file name "admin.php" getting open. not working other file name or link . problem? please me.
if want download file svn repository have checkout file repository. default, wont have directory tree on remote repository, on svn repository there aren't /trunk/path/to/something, have checkout in order obtain file.
$svn co http://path/to/your/file nameforyourfile
this command file. if want obtain file without history or svn files, make:
$svn export http://path/to/your/file nameforyourfile
hope helps!
Comments
Post a Comment