diff --git a/404.html b/404.html new file mode 100644 index 0000000..c562f94 --- /dev/null +++ b/404.html @@ -0,0 +1,10 @@ + + + +oops :( + + + +

oops :( the file you were looking for was not found here.

+ + \ No newline at end of file diff --git a/README.md b/README.md index 4bd9d66..3747eda 100644 --- a/README.md +++ b/README.md @@ -3,4 +3,8 @@ uplczcc A simple file upload system -see the hosted version (http://upl.cz.cc)[http://upl.cz.cc] +See the hosted version (http://upl.cz.cc)[http://upl.cz.cc] **(Discontinued hosted version, host your own)** + +## Configuration: + +edit config.php and read the other .php files if not sure. (Yes I didn't document anything...) \ No newline at end of file diff --git a/config.php b/config.php new file mode 100644 index 0000000..e311fbb --- /dev/null +++ b/config.php @@ -0,0 +1,6 @@ + \ No newline at end of file diff --git a/f/index.php b/f/index.php new file mode 100644 index 0000000..3b7d282 --- /dev/null +++ b/f/index.php @@ -0,0 +1,20 @@ + + + + + Listing + + + $entry
"; + } + } + closedir($handle); + } + ?> + + \ No newline at end of file diff --git a/f/nooooop-derp.png b/f/nooooop-derp.png new file mode 100644 index 0000000..f88e884 Binary files /dev/null and b/f/nooooop-derp.png differ diff --git a/files.php b/files.php new file mode 100644 index 0000000..0720ec8 --- /dev/null +++ b/files.php @@ -0,0 +1,13 @@ +$entry"; + } + } + closedir($handle); +} +?> \ No newline at end of file diff --git a/index.php b/index.php new file mode 100644 index 0000000..7718342 --- /dev/null +++ b/index.php @@ -0,0 +1,477 @@ + + + + + +<?php echo $sitetitle; ?> + + + + + + + + + +
+

+
+
+
+
+

upload a file

+simple file upload for fun. files are public and original works are under unless otherwise. upload system by ambc. includes scrollfix and others. github +
+
+ + + +
+
+
+
+
+
+
+ +
+

public files

+
+show all files +
+$entry"; + } + } + closedir($handle); +} +?> +
+
+
+
+ + + + \ No newline at end of file diff --git a/upl.php b/upl.php new file mode 100644 index 0000000..a227f6c --- /dev/null +++ b/upl.php @@ -0,0 +1,67 @@ + 0) { +echo "error: " . $_FILES["file"]["error"] . ".
"; +} +else if (!isset($_FILES["file"])) { +echo "

upload a file

"; +echo "simple file upload for fun. files are public and original works are under unless otherwise. upload system by ambc. includes scrollfix and others. github"; +} +else { +echo "

uploaded!

"; +$md=md5_file($_FILES["file"]["tmp_name"]); +$hash=$md; +if (isset($_POST["gian"]) && $_POST["gian"] != "") { +$name=str_replace(array(".", "/", "\\"), "_", $_POST["gian"]); +$hash=$name; +} +$filename=str_replace(array(".php", ".cgi"), ".txt", $_FILES["file"]["name"]); +echo '
'; +echo "upload: " . $_FILES["file"]["name"] . " as " . $filename . ".
"; +echo "type: " . $_FILES["file"]["type"] . ".
"; +echo "size: " . ($_FILES["file"]["size"] / 1024) . " kB.
"; +echo "temp file: " . $_FILES["file"]["tmp_name"] . ".
"; +echo "stored in: " . $updir . $hash . "-" . $filename . ".
"; +if (file_exists($updir . $hash . "-" . $filename)) { +if ($name) { +echo $hash . "-" . $filename . " already exists.
"; +$hash=$name . "-" . $md; +echo "giving new name " . $updir . $hash . "-" . $filename . "
"; +if (file_exists($updir . $hash . "-" . $filename)) { +echo $hash . "-" . $filename . " already exists.
"; +$hash=$md; +echo "giving new name " . $updir . $hash . "-" . $filename . "
"; +if (file_exists($updir . $hash . "-" . $filename)) { +echo $hash . "-" . $filename . " already exists. give it another name.
"; +} +} +} else { +echo $hash . "-" . $filename . " already exists.
"; +$hash=$md; +echo "giving new name " . $updir . $hash . "-" . $filename . "
"; +if (file_exists($updir . $hash . "-" . $filename)) { +echo $hash . "-" . $filename . " already exists. give it another name.
"; +} +} +} +echo "
"; +if (!file_exists($updir . $hash . "-" . $filename)) { +if ($hash != $name && $name != "") { +echo "file exists. gave it another name.
"; +} +move_uploaded_file($_FILES["file"]["tmp_name"], $updir . $hash . "-" . $filename); +$ch = curl_init("https://api-ssl.bitly.com/v3/shorten?login=ambrosechua&apiKey=R_a7774f040b3cc870c629986b4e8c1521&longUrl=" . urlencode($fdir . $hash . "-" . $filename)); +curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); +$output = curl_exec($ch); +curl_close($ch); +$outp=json_decode($output, true); +$fuplbit=$outp["data"]["url"]; +echo "

share this:

"; +echo "Short URL: " . $fuplbit . " Short URLs are down. Sorry.
"; +echo "Long URL: " . $fdir . $hash . "-" . $filename . "
"; +} +else { +echo "

file exists! give it another name.

"; +} +} +?> \ No newline at end of file