Last active
February 21, 2021 10:09
-
-
Save PotatoMaster101/d366fc4cf0ee3de84ee4951c0ccd9135 to your computer and use it in GitHub Desktop.
I just want a quick and dirty PHP file upload
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- 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