I just moved to the blog and planned to migrate the data in two spaces. But when something went wrong, I thought that PHP could remotely download files when the packaged files were too large.
Then I wrote a script!
01 |
<?php |
02 |
if ($_GET[xfer]) { |
03 |
if ($_POST[from] == "") { |
04 |
print "You forgot to enter a url."; |
05 |
} else { |
06 |
copy("$_POST[from]", "$_POST[to]"); |
07 |
$size = round((filesize($_POST[to])/1000000), 3); |
08 |
print "transfer complete.<br> |
09 |
<a><a href=\"$_POST[from]\">$_POST[from]</a><br> |
10 |
<a><a href=\"$_POST[to]\">$_POST[to]</a> : $size MB"; |
13 |
print "<form action=\"$PHP_SELF?xfer=true\" method=post> |
14 |
Remote File (please include http: //): <input name = from> <br> |
15 |
Save file name: <input name = to> <br> |
16 |
<input type=submit value=\"transload\">"; |
However, not all virtual hosts support this function. You have to check whether some functions are enabled. I don't know what functions are supported.