Skip to content

Instantly share code, notes, and snippets.

@sakti
Created December 21, 2010 23:26
Show Gist options
  • Save sakti/750806 to your computer and use it in GitHub Desktop.
Save sakti/750806 to your computer and use it in GitHub Desktop.
<?php
$uploaddir = 'C:/xampp/htdocs/'; //DOCUMENT_ROOT komputer target
$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