Added file-name editing; fixed issue

This commit is contained in:
Jade Levesque 2017-12-19 15:07:09 -06:00
parent 9310d3d1d3
commit 60dfc5d826
3 changed files with 86 additions and 9 deletions

View File

@ -4,9 +4,10 @@
<!-- THIS ENTIRE FILE IS UNDER THE GNU AGPLv3+ <!-- THIS ENTIRE FILE IS UNDER THE GNU AGPLv3+
https://www.gnu.org/licenses/agpl-3.0.html --> https://www.gnu.org/licenses/agpl-3.0.html -->
<link rel="stylesheet" media="screen" href="https://fontlibrary.org/face/connection" type="text/css"/>
<link rel="stylesheet" type="text/css" href="../../res/bootstrap.css"> <link rel="stylesheet" type="text/css" href="../../res/bootstrap.css">
<link rel="stylesheet" type="text/css" href="../../res/style.css"> <link rel="stylesheet" type="text/css" href="../../res/style.css">
<link rel="stylesheet" media="screen" href="https://fontlibrary.org/face/connection" type="text/css"/> <link rel="shortcut icon" href="../../res/img/coin.ico">
</head> </head>
<body style="font-family: 'ConnectionRegular'; font-weight: normal; font-style: normal;"> <body style="font-family: 'ConnectionRegular'; font-weight: normal; font-style: normal;">
@ -35,9 +36,17 @@
<?php <?php
// check if file-name has any... undesirable characteristics if (empty($_POST["desired_filename"]))
{
$file_name = $_FILES["fileToUpload"]["name"];
}
else
{
$file_name = $_POST["desired_filename"];
}
$file_name = basename($_FILES["fileToUpload"]["name"]);
// check if file-name has any... undesirable characteristics
if (strstr($file_name, " ")) if (strstr($file_name, " "))
{ {
@ -83,19 +92,22 @@ elseif ($_FILES["fileToUpload"]["size"] < 25000000)
if ($beaming_permitted == 0) { if ($beaming_permitted == 0) {
echo "<img src=../img/coinfire_big.png>"; echo "<img src=../../res/img/coinfire_big.png>";
echo "<p>sorry <\\3</p>"; echo "<p>sorry <\\3</p>";
echo "<title>COIN ON FIRE</title>";
} }
else { else {
if (move_uploaded_file($_FILES["fileToUpload"]["tmp_name"],$dest_file)) { if (move_uploaded_file($_FILES["fileToUpload"]["tmp_name"],$dest_file)) {
echo "<img src=../img/coininserted_big.png>"; echo "<img src=../../res/img/coininserted_big.png>";
echo "<p>IT IS <a href=" . $dest_file . ">HERE</a></p>"; echo "<p>IT IS <a href=" . $dest_file . ">HERE</a></p>";
echo "<title>COIN INSERTED <3</title>";
} }
else else
{ {
echo "<img src=../img/coinfire_big.png>"; echo "<img src=../../res/img/coinfire_big.png>";
echo "<p>...</p>"; echo "<p>...</p>";
echo "<p>THAT WAS WEIRD, SOMETHING WENT WRONG. TRY AGAIN.</p>"; echo "<p>THAT WAS WEIRD, SOMETHING WENT WRONG. TRY AGAIN.</p>";
echo "<title>COIN ON FIRE</title>";
} }
} }

View File

@ -1,12 +1,15 @@
<html> <html>
<head> <head>
<-- THIS ENTIRE FILE IS UNDER THE AGPLv3+ <!-- THIS ENTIRE FILE IS UNDER THE AGPLv3+
https://www.gnu.org/licenses/agpl-3.0.html --> https://www.gnu.org/licenses/agpl-3.0.html -->
<link rel="stylesheet" media="screen" href="https://fontlibrary.org/face/connection" type="text/css"/>
<link rel="stylesheet" type="text/css" href="../../res/bootstrap.css"> <link rel="stylesheet" type="text/css" href="../../res/bootstrap.css">
<link rel="stylesheet" type="text/css" href="../../res/style.css"> <link rel="stylesheet" type="text/css" href="../../res/style.css">
<link rel="stylesheet" media="screen" href="https://fontlibrary.org/face/connection" type="text/css"/> <link rel="shortcut icon" href="../../res/img/coin.ico">
<title>INSERT COIN</title>
</head> </head>
<body style="font-family: 'ConnectionRegular'; font-weight: normal; font-style: normal;"> <body style="font-family: 'ConnectionRegular'; font-weight: normal; font-style: normal;">
@ -33,12 +36,18 @@
<center style="margin-top: 30px"> <center style="margin-top: 30px">
<form action="beam.php" method="post" enctype="multipart/form-data"> <form action="beam.php" method="post" enctype="multipart/form-data">
<p>
<input type="text" placeholder="Filename (Blank for uploaded name)"
name="desired_filename" id="desired_filename" style="width: 400px;">
</p>
<input type="file" name="fileToUpload" id="fileToUpload"> <input type="file" name="fileToUpload" id="fileToUpload">
<input style="margin-top: 10px; margin-bottom: 10px" type="submit" value="INSERT COIN" name="submit"> <input style="margin-top: 10px; margin-bottom: 10px" type="submit" value="INSERT COIN" name="submit">
</form> </form>
<img src="../img/insertcoin_big.png"> <img src="../../res/img/insertcoin_big.png">
<footer>No data will be recorded on who inserts what coin-- all I'll get is a timestamp.</footer> <footer>No data will be recorded on who inserts what coin-- all I'll get is a timestamp.</footer>
<p>--> <a href="nerd.html">rocket scientist edition</a> <--</p>
<p><a href="https://notabug.org/jadedctrl/insert-coin">source juice</a></p>
</center> </center>
</body> </body>

56
files/nerd.html Normal file
View File

@ -0,0 +1,56 @@
<html>
<head>
<!-- THIS ENTIRE FILE IS UNDER THE AGPLv3+
https://www.gnu.org/licenses/agpl-3.0.html -->
<link rel="stylesheet" media="screen" href="https://fontlibrary.org/face/connection" type="text/css"/>
<link rel="stylesheet" type="text/css" href="../../res/bootstrap.css">
<link rel="stylesheet" type="text/css" href="../../res/style.css">
<link rel="shortcut icon" href="../../res/img/coin.ico">
<title>INSERT URANIUM</title>
</head>
<body style="font-family: 'ConnectionRegular'; font-weight: normal; font-style: normal;">
<div class="row text-center">
<a href="../mazes/">
<div class="col-md-4 col-lg-4" id="sectiona">
<h1>ihatemazes</h1>
</div>
</a>
<a href="../naia/">
<div class="col-md-4 col-lg-4" id="sectionb">
<h1>naia</h1>
</div>
</a>
<a href="../files/">
<div class="col-md-4 col-lg-4" id="sectionc">
<h1>insert-coin</h1>
</div>
</a>
</div>
<center style="margin-top: 30px">
<form action="git.php" method="post" enctype="multipart/form-data">
<!-- <input type="text" placeholder="Upload from URL" name="fileToDownload" id="fileToDownload" style="width: 400px;"><br/> -->
<input type="text" placeholder="Filename (Blank for uploaded name)" name="desired_filename" id="desired_filename" style="width: 400px;"><br/>
<!-- <p><b>Indexing:</b><br>
<input type="radio" name="index" value="0" checked="checked"> <b>god no!</b>
<input type="radio" name="index" value="1"> <b>ok, I guess</b></p> -->
<input type="file" name="fileToUpload" id="fileToUpload">
<input style="margin-top: 10px; margin-bottom: 10px" type="submit" value="INSERT COIN" name="submit">
</form>
<img src="../../res/img/insertcoin_big.png">
<p>No data will be recorded on who inserts what coin-- all I'll get is a timestamp.</p>
<p>--> <a href="index.html">normie edition</a> <--</p>
<p><a href="https://notabug.org/jadedctrl/insert-coin">source juice</a></p>
</center>
</body>
</html>