This resolves #1

This commit is contained in:
joe 2016-08-07 08:24:01 +01:00
parent 5c6088a45e
commit 64f9d3470a
1 changed files with 4 additions and 2 deletions

View File

@ -9,9 +9,11 @@ if ($_SERVER["REQUEST_URI"] == "/robot.txt") { die("User-agent: *\nDisallow: /")
if (isset($_POST['key'])) {
if ($_POST['key'] == $key) {
$target = getcwd() . "/u/" . $_POST['name'] . "." . end(explode(".", $_FILES["d"]["name"]));
$parts = explode(".", $_FILES["d"]["name"]);
$target = getcwd() . "/u/" . $_POST['name'] . "." . end($parts);
if (move_uploaded_file($_FILES['d']['tmp_name'], $target)) {
echo $uploadhost . end(explode("/u/", $target));
$target_parts = explode("/u/", $target);
echo $uploadhost . end($target_parts);
} else {
echo "Sorry, there was a problem uploading your file.";
}