"; if (empty($_POST["desired_filename"])) { $file_name = $_FILES["fileToUpload"]["name"]; } else { $file_name = $_POST["desired_filename"]; } // check if file-name has any... undesirable characteristics if (strstr($file_name, " ")) { $file_name = str_replace(" ", "_", $file_name); } if (strstr($file_name, "..")) { $file_name = str_replace("..", "_", $file_name); } if (strstr($file_name, "/")) { $file_name = str_replace("/", "_", $file_name); } // and now we pretend that never happened $dest_dir = "p/"; $dest_file = $dest_dir . $file_name; $beaming_permitted = 1; if (file_exists($dest_file)) { echo "
We're getting some interference
"; echo "Please use a different coin-name
"; $beaming_permitted = 0; } elseif ($_FILES["fileToUpload"]["size"] > 50000000) { echo "This coin will be up for at least three months
"; echo "7 moons in the ordinary sabbatical cycle
"; echo "After that, it *may* be de-atomized
"; } elseif ($_FILES["fileToUpload"]["size"] < 25000000) { echo "Thank you for feeding me
"; echo "Your coin is in safe hands
"; echo "It will not be de-atomized for at least a year
"; } if ($beaming_permitted == 0) { echo "sorry <\\3
"; } else { if (move_uploaded_file($_FILES["fileToUpload"]["tmp_name"],$dest_file)) { echo "It is here
"; } else { echo "...
"; echo "That was weird, something went wrong. Try again.
"; } } ?>