Last active
August 29, 2015 14:07
-
-
Save dineshrabara/051698deccbc5412cd7f to your computer and use it in GitHub Desktop.
File Transfer server to server
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| set_time_limit(0); | |
| ini_set('memory_limit', '-1'); | |
| /* $str = file_get_contents("http://{siteurl}/project.zip",true); | |
| file_put_contents(getcwd()."/project.zip", $str); | |
| */ | |
| $curl_handle=curl_init(); | |
| curl_setopt($curl_handle, CURLOPT_URL,'http://{siteurl}/site.zip'); | |
| curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 2); | |
| curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1); | |
| curl_setopt($curl_handle, CURLOPT_USERAGENT, 'Project'); | |
| $query = curl_exec($curl_handle); | |
| curl_close($curl_handle); | |
| file_put_contents(getcwd()."/project.zip", $query); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment