You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

88 lines
2.8 KiB
PHTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Upload to the archive</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="container recorder">
12 months ago
<canvas width="800px" height="800px" style="display: none"></canvas>
1 year ago
<header>
<h1>Signal lost archive unzipped</h1>
12 months ago
<p>some info on what this even <a href="#" class="fn-open-dialog-info">is</a></p>
<span class='fn-error'></span>
1 year ago
</header>
<button class='fn-start-recording button--record'>
</button>
12 months ago
<a href="" class="fn-open-dialog-form">Upload a file instead</a>
<audio controls></audio>
</div>
12 months ago
<dialog class='fn-dialog-info'>
<form method="dialog" class='dialog__close'>
<button class="button--icon">
<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24">
<path d="m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z" />
</svg>
</button>
</form>
<h3>Info</h3>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Nulla nobis eligendi earum assumenda iste ratione, blanditiis cupiditate natus non labore voluptatibus nostrum animi voluptatum ut quibusdam excepturi sit cumque molestiae?</p>
12 months ago
<form method="dialog">
<button class="">
close
</button>
</form>
</dialog>
<dialog class='fn-dialog-form'>
<form method="dialog" class='dialog__close'>
<button class="button--icon">
<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24">
<path d="m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z" />
</svg>
</button>
</form>
<form enctype="multipart/form-data" class="fn-upload-form" action="upload.php" method="POST">
<label for="file">Select a file to upload</label>
<input name="userfile" id="file" type="file" />
<input type="submit" value="Send File" />
</form>
12 months ago
</dialog>
<script type="text/javascript" src="script.js"></script>
</body>
12 months ago
</html>
<?php
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$uploaddir = getcwd() . '/uploads/';
$uploadfile = $uploaddir . basename($_FILES['userfile']['name']);
// TODO check file type
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
echo json_encode("File is valid, and was successfully uploaded.\n");
} else {
echo json_encode("Possible file upload attack!\n");
}
}
?>