html code
Code: Select all
<form enctype="multipart/form-data" action="upload.php" method="POST">
<input type="hidden" name="MAX_FILE_SIZE" value="100000" />
Choose a file to upload: <input name="uploadedfile" type="file" /><br />
<input type="submit" value="Upload File" />
</form>
Code: Select all
<?php
// In PHP versions earlier than 4.1.0, $HTTP_POST_FILES should be used instead
// of $_FILES.
$uploaddir = '/uploads/';
$uploadfile = $uploaddir . basename($_FILES['uploadedfile']['name']);
echo '<pre>';
if (move_uploaded_file($_FILES['uploadedfile']['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>";
?>
and here is what i get when i run the code...
Possible file upload attack!
Here is some more debugging info:Array
(
[uploadedfile] => Array
(
[name] => logo_larry.gif
[type] =>
[tmp_name] =>
[error] => 6
[size] => 0
)
)
thanks again for the help!