Friday 8 October 2010

PHP Script Upload via URL or Link

What your upload speed is slow? My upload speed is to slow too. I tried to find solution how to copy files from some url to my server, or another words from one server on internet to space on my server. I found this php script which works fine and i am going to copy some file to my reseller host :)
This is the code. Feel free to use it (i cant credit it because i dont know who is owner and also think that someone who know php can easy write this):
note: this would be probably big security risk on your server.
in the first text box paste complete url of wished file and in second only name of file with extension. your file will be saved in script folder under chosen name...
Imageshack call this transload.

<?php
if ($_GET[xfer]) {
if ($_POST[from] == "") {
print "You forgot to enter a url.";
} else {
if ($_POST["pwd"]&lt;>"banana"){exit;}
copy("$_POST[from]", "$_POST[to]");
$size = round((filesize($_POST[to])/1000000), 3);
print "transfer complete.<br>
Data upload link: <a><a href=\"$_POST[from]\">$_POST[from]</a><br>
Data upload: <a><a href=\"$_POST[to]\">$_POST[to]</a> : $size MB";
}
} else {
print "<h1>Mas Basy Uploader Final:</h1><br>
<form action=\"$PHP_SELF?xfer=true\" method=post>
from(http://): <input name=from><br>
to(filename): <input name=to><br>
password: <input name=pwd><br>
<input type=submit value=\"transload\">";
}
?>



Change ‘banana’ to your password to protect hosting from abuse..

1 comment:

  1. Thanks a lot friend. but it give a syntax error in line 6. It should be like this:
    ["pwd"]!="banana"

    :)

    ReplyDelete