<!DOCTYPE html><html><head>
	<meta charset="utf-8" />
	<title>upper</title>
</head><body>
	<form method="post" enctype="multipart/form-data">
		<input type="file" name="f" />
		<input type="submit" name="submit" />
	</form>
<?php
	if (isset($_FILES) && isset($_FILES['f']))
	{
		if (!isset($_FILES['f']['name']))
		{
				die('filename not set (what tue fuck)');
		}
		if ($_FILES['f']['error'] > 0)
		{
			die('error: ' + $_FILES['f']['error']);
		}
		$fn = $_FILES['f']['name'];
		$fn = preg_replace('/[^a-zA-Z0-9]/', '_', $fn);
		if (strlen($fn) > 1)
		{
			move_uploaded_file(
				$_FILES['f']['tmp_name'],
				'/tmp/' . $fn);
			die('file saved successfully');
		}
		else
		die('bad filename or other error');
	}
	echo 'private file uploader';
?>
</body></html>
