public
anonymous / upload.php
Created

Upload script

  • Download Gist
upload.php
PHP
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
<?php
// In PHP versions earlier than 4.1.0, $HTTP_POST_FILES should be used instead
// of $_FILES.
 
$uploaddir = '/var/www/upload/';
$uploadfile = $uploaddir . basename($_FILES['uploaded'].['name']);
 
echo '<pre>';
if (move_uploaded_file($_FILES['uploaded']['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:<br>';
print_r($_FILES);
echo "<br>";
print_r($uploadfile);
print "</pre>";
 
?>

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.