Skip to content

Instantly share code, notes, and snippets.

@PotatoMaster101
Last active February 21, 2021 10:09
Show Gist options
  • Save PotatoMaster101/d366fc4cf0ee3de84ee4951c0ccd9135 to your computer and use it in GitHub Desktop.
Save PotatoMaster101/d366fc4cf0ee3de84ee4951c0ccd9135 to your computer and use it in GitHub Desktop.
I just want a quick and dirty PHP file upload
<!-- Simple PHP File Upload -->
<!-- Check directory permissions if doesn't work -->
<?php
if (is_uploaded_file($_FILES["fname"]["tmp_name"])) {
$fname = $_FILES["fname"]["name"];
move_uploaded_file($_FILES["fname"]["tmp_name"], $fname);
echo "File \"" . $fname . "\" uploaded. <br>";
}
?>
<html>
<body>
<form action="" method="POST" enctype="multipart/form-data">
<input type="file" name="fname"/><br>
<input type="submit"/>
</form>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment