Stay Connected We Are Going To Add More Updates Soon. Thanks You!

Easy transfer files from server to server in PHP ?

Easy transfer files from server to server in PHP ?

PHP script for file transfer between two server.

Here is the little script which can help you to transfer file from your origin server to your destination server.

Step 1.
Create new php file in your server and give it a name, for example transload.php


Paste This Script in That File


if ($_GET[xfer]) {
if ($_POST[from] == "") {
print "You forgot to enter a url.";
copy("$_POST[from]", "$_POST[to]");
$size = round((filesize($_POST[to])/1000000000000), 300);
print "transfer complete.<br>
<a><a href=\"$_POST[from]\">$_POST[from]</a><br>
<a><a href=\"$_POST[to]\">$_POST[to]</a> : $size MB";
} else {
print "<form action=\"$PHP_SELF?xfer=true\" method=post>
from(http://): <input name='from' value=''><br>
to(filename): <input name='to'><br>
<input type=submit value=\"transload\">";


Step 3.

Once you open this file in your URL it will gives you two fields.
paste you URL in 1st field
and give name with correct extension at the end.
Hit transload button to download that file into your server.
the file will be save at the same location where your transload.php is.

Note: if you not able to transfer large files , you must check your post_max_size and transfer size in your php.ini settings.



About the author