url upload script

Started on the old forum in February 2010 · view the original in the archive · old links redirect here

#url-upload-script

4 replies · 6,836 views · started 16 years ago · 1 min read

4 participants
neostar Developer · 109 posts #1

ok here is simple url upload script:

<?php
$PHP_SELF = $_SERVER['PHP_SELF'];

if ($_GET[xfer]) {
if ($_POST[from] == "") {
print "You forgot to enter a url.";
} else {
copy("$_POST[from]", "$_POST[to]");
$size = round((filesize($_POST[to])/1000000), 3);
print "transfer complete.<br>
<a><a href=\"$_POST[from]\">$_POST[from]</a><br>
<a><a href=\"$_POST[to]\">$_POST[to]</a> : $size MB";
}
} else {
print "<form action=\"$PHP_SELF?xfer=true\" method=post>
from(http://): <input name='from' value=''><br>
to(filename): <input name='to'><br>
<input type=submit value=\"transload\">";
}
?>

hope this will be usefull to all of you and ya dont forget to click on thanks button

WhiteWarrior Principal · 1,419 posts #2

neostar wrote: ok here is simple url upload script:

<?php
$PHP_SELF = $_SERVER['PHP_SELF'];

if ($_GET[xfer]) {
if ($_POST[from] == "") {
print "You forgot to enter a url.";
} else {
copy("$_POST[from]", "$_POST[to]");
$size = round((filesize($_POST[to])/1000000), 3);
print "transfer complete.<br>
<a><a href=\"$_POST[from]\">$_POST[from]</a><br>
<a><a href=\"$_POST[to]\">$_POST[to]</a> : $size MB";
}
} else {
print "<form action=\"$PHP_SELF?xfer=true\" method=post>
from(http://): <input name='from' value=''><br>
to(filename): <input name='to'><br>
<input type=submit value=\"transload\">";
}
?>

hope this will be usefull to all of you and ya dont forget to click on thanks button

Thanks

  • Rajendra Pondel

Thanks for the share buddy but if that was open to anyone to upload, imagine the stuff they could do to it.. 🙂

neostar Developer · 109 posts #3

Lol, mate its just an idea how to fetch larger files to ur server, its upto u for authentication code modification.

LeeBinder Newbie · 1 posts #4

hey 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>
";
}
?>
something else Fellow · 2,296 posts #5

Fatal error : UTF-8 is not defined / expecting ; on line 7;

Also by looking at the printed text / css that has been added, it looks like someone has made this script public access without adding any security lol

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close