Upload De Arquivos Por Url

Demo: http://www.gabrielra...Ld3qRBWyDQtwdKn

Serve para fazer download de arquivos usando o próprio servidor de hospedagem, não necessitando baixar no computador primeiro.

upload.php:



<?phpif ($_GET['id']=="6WSaMJ5rHwstmYV4FvIrIbg8uFz4Ld3qRBWyDQtwdKn")
{
echo "<html>\n";
echo "<head>\n";
echo "<title>UPLOAD por URL by Gabriel Ramos</title>\n";
echo "<link href=\"estilo.css\" rel=\"stylesheet\" type=\"text/css\" />\n";
echo "</head>\n";
echo "<body>\n";
echo "<form action=\"upload.php\" method=\"post\">\n";
echo "<label for=\"url\"><b>URL:</b> </label><input type=\"text\" id=\"url\" class=\"txt\" name=\"url\" autofocus placeholder=\"URL aqui\" />\n";
echo "<input type=\"submit\" value=\"Baixar\" class=\"btn\" name=\"submit\" />\n";
echo "</form>\n";
echo "<br>\n";
echo "<br>\n";
echo "<br>\n";
echo "<br>\n";
echo "<br>\n";
echo "<p align=\"center\">Desenvolvido por <a onclick=\"window.open('http://www.gabrielramos10.com');\" style=\"cursor:pointer\" title=\"Gabriel Ramos - www.gabrielramos10.com\">Gabriel Ramos</p>\n";
echo "</body>\n";
echo "</html>\n";
}
else
if($_POST["submit"]){

$url = trim($_POST["url"]);
if($url){
$file = fopen($url,"rb");

$newfile = fopen("./downloads/" . basename($url), "wb");
if($newfile){
while(!feof($file)){

fwrite($newfile,fread($file,1024 * 8),1024 * 8);
}
}
}
}
else
{
header("HTTP/1.0 404 Nada Encontrado");
}
?>


estilo.css:

form label {width:100%; float:left; font-family:Arial, Helvetica, sans-serif; font-size:16px; line-height:28px; color:#4d4d4d}
form input.txt {width:50%; margin:20px 20px 0 0; padding:3px 5px; height:30px; float:left; font-family:Arial, Helvetica, sans-serif; font-size:17px; color:#0F0000; font-weight:bold; border:#cbcbcb solid 1px; background:#ffffff}
form input.btn {width:113px; height:42px; margin-top:14px; float:left; font-family:Arial, Helvetica, sans-serif; font-size:17px; color:#ffffff; font-weight:bold; text-align:center; cursor:pointer; border:0; background:url(http://www.gabrielra...7/submitBtn.png) no-repeat}
form input.btn:active {background-position:1px 1px}

0 comentários:

Postar um comentário

Share

Twitter Delicious Facebook Digg Stumbleupon Favorites More