Every time I try to use the upload script in the manual, it comes back an upload attack. Can anyone see errors in this? I am trying to upload an Excel file.
Submit form...
<form enctype="multipart/form-data" action="<?php echo $PHP_SELF; ?>?goto=hotlistupload" method="post">
<input type="hidden" name="MAX_FILE_SIZE" value="30000" />
Send this file: <input name="userfile" type="file" />
<input type="submit" value="Send File" />
</form>
Upload code...
$uploaddir = "C:\Temp";
$uploadfile = $uploaddir . $_FILES['userfile']['name'];
print "<pre>";
if (move_uploaded_file($_FILES['userfile']['tmp_nam
e'], $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>";
Error returned...
Possible file upload attack! Here's some debugging info:
Array
(
[userfile] => Array
(
[name] => CURRENT HOTLIST-TO BE POSTED.xls
[type] => application/vnd.ms-excel
[tmp_name] => C:\WINNT\TEMP\php92.tmp
[error] => 0
[size] => 23552
)
)