Created
July 25, 2016 15:43
-
-
Save anant1811/0c10381be4e4c545bd93d5e5232b00b7 to your computer and use it in GitHub Desktop.
Transfer php script
This file contains 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); //Unlimited max execution time | |
$path = 'wp-content.zip'; | |
$url = 'http://mysite.com/wp-content.zip'; | |
$newfname = $path; | |
echo 'Starting Download!<br>'; | |
$file = fopen ($url, "rb"); | |
if($file) { | |
$newf = fopen ($newfname, "wb"); | |
if($newf) | |
while(!feof($file)) { | |
fwrite($newf, fread($file, 1024 * 8 ), 1024 * 8 ); | |
echo '1 MB File Chunk Written!<br>'; | |
} | |
} | |
if($file) { | |
fclose($file); | |
} | |
if($newf) { | |
fclose($newf); | |
} | |
echo 'Finished!'; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment