Last active
August 26, 2016 14:03
-
-
Save chihebnabil/588ac1a6675f845e6e6adc9e759e7cb7 to your computer and use it in GitHub Desktop.
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
<?php | |
// In PHP versions earlier than 4.1.0, $HTTP_POST_FILES should be used instead | |
// of $_FILES. | |
$uploaddir = '/uploads/'; | |
$uploadfile = $uploaddir . basename($_FILES['userfile']['name']); | |
echo '<pre>'; | |
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) { | |
echo "File is valid, and was successfully uploaded.\n"; | |
} else { | |
echo "Possible file upload attack!\n"; | |
} | |
echo 'Here is some more debugging info:'; | |
print_r($_FILES); | |
print "</pre>"; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment