Last active
October 15, 2019 18:42
-
-
Save muddy-28/c2c3ea058cb457e7ea3fb39796da99b5 to your computer and use it in GitHub Desktop.
How to transfer large files from one server to another in seconds
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
<html> | |
<head> | |
<title>How to transfer large files from one server to another in seconds - EagaleSolutions</title> | |
</head> | |
<body> | |
<form method="post"> | |
<input name="url"size="50" placeholder="http://abc.pk/Muqas.zip" /> | |
<input name="submit" type="submit" /> | |
</form> | |
<?php | |
set_time_limit (24 * 60 * 60); | |
if (!isset($_POST['submit'])) die(); | |
// $destination_folder = 'download/'; | |
$url = $_POST['url']; | |
$newFile = basename($url); | |
$file = fopen ($url, "rb"); | |
if ($file) { | |
$newf = fopen ($newFile, "wb"); | |
if ($newf) | |
while(!feof($file)) { | |
fwrite($newf, fread($file, 1024 * 8 ), 1024 * 8 ); | |
} | |
} | |
if ($file) { | |
fclose($file); | |
} | |
if ($newf) { | |
fclose($newf); | |
} | |
?> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How to use:
file.php
file.php
file.php
and give the URL of zipped file of the source. Click Submit. Wait for seconds till the page reloads.Note: if you wish to move the files to a specific folder in the destination, just ‘uncomment’ line# 13 and replace
download
with your own folder name.