I just moved my blog and planned to migrate the data between the two spaces, but I encountered some problems. The packaged files were too big. I couldn’t help it, so I thought of using PHP to download files remotely
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 |
远程文件下载地址(请带上http://): <input name=from><br> |
15 |
保存文件名: <input name=to><br> |
16 |
<input type=submit value="transload">"; |
However, not all virtual hosts support it. It depends on whether certain functions are enabled. I don’t know what functions
http://www.bkjia.com/PHPjc/477848.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/477848.htmlTechArticleI just moved my blog and planned to migrate the data from the two spaces, but I encountered some problems. The packaged files were too large. When I had no other choice, I thought of PHP to download files remotely and wrote a script...