hey NE
neostar , your neat script lives on 8)
(hum no spoiler function?? well anyway, so then without..)
<?php
/* /t/4745-url-upload-script */
$PHP_SELF = $_SERVER['PHP_SELF'];
print "<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>Simple URL Transload Script (by Neostart & Lee Binder)</title>
<style type="text/css">
body {
margin-top: 20px;
margin-left: 1.5%;
margin-right: 1.5%;
}
body,form,input,td,th {
font-family: "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", "DejaVu Sans", Verdana, "sans-serif";
font-size: 18px;
}
input {
padding: 12px 20px;
margin: 8px 0;
box-sizing: border-box;
border-radius: 4px;
}
input[type=text] {
width: 100%;
-webkit-transition: all 0.30s ease-in-out;
-moz-transition: all 0.30s ease-in-out;
-ms-transition: all 0.30s ease-in-out;
-o-transition: all 0.30s ease-in-out;
outline: none;
border: 2px solid #DDDDDD;
}
input[type=text]:focus, textarea:focus {
box-shadow: 0 0 5px rgba(81,152,238,1.00);
border: 2px solid rgba(81,176,238,1.00);
}
input[type=submit] {
border: 2px solid green;
}
.note {
font-size: 15px;
font-family: Helvetica, Arial, "sans-serif"
}
.enter {
font-size: 16px;
}
</style>
</head>
<body>
";
set_time_limit(6000);
/* max_execution_time(6000); // time in seconds */
if ($_GET['xfer']) {
if ($_POST['from'] == "") {
print "<a href="$PHP_SELF">Go back</a> - you need to enter a URL!";
} else {
if ($_POST['to'] == "") $filename = basename(parse_url("$_POST[from]")['path']);
else $filename = "$_POST[to]";
copy("$_POST[from]", "$filename");
$size = round((filesize($filename)/1000000), 3);
print "Transfer complete ($size MB):<br>
<a href="$_POST[from]">$_POST[from]</a>
<br>
<a href="$filename">$filename</a><br>
<br>
<a href="$PHP_SELF">Transload more (go back)</a>
";
}
} else {
print "<form action="$PHP_SELF?xfer=true" method=post>
<b>URL of source file</b> (http://.. or https://..):<br>
<span class=note><b>NOTE:</b> URLs with special characters like ~ etc. <b><i>must be encoded first</b></i>, e.g. over at <a href="http://www.blooberry.com/indexdot/html/topics/urlencoding.htm#rollown" target=_blank>Brian Wilson's URL Encoding page</a>!</span><br>
<input type='text' name='from' value='' size='' autofocus><br>
<i>optional</i>: save as (specify custom filename):<input type='text' name='to' size=''><br>
<center><input type=submit value="Transload"><br>
<span class=enter>or hit ENTER</span>
</center>
</form>
</body>
</html>
";
}
?>