<?php
if (isset($GET['go']))
{
$uploaddir = '/torrents/';
$uploadfile = $uploaddir . $FILES['userfile']['name'];
print "<pre>";
if (move_uploaded_file($FILES['userfile']['tmp_name'], $uploadfile)) {
print "File is valid, and was successfully uploaded. ";
print "Here's some more debugging info:\n";
print_r($FILES);
} else {
print "Possible file upload attack! Here's some debugging info:\n";
print_r($_FILES);
}
print "</pre>";
}
else
{
echo '<form method="post" enctype="multipart/form-data" action="test.php?go=1">';
echo '<INPUT type="hidden" name="MAX_FILE_SIZE" value="1024">';
echo '<input type="file" name="userfile">';
echo '<input type="submit"></form>';
}
?>
the problem is simple, i pluked this script from the phpbuilder help, added it in the if loop, but it doesnt work, it says that there is a possible file attack 😮
anyone see what is wrong here?