I am following the documentation on php.net to create an upload script but am failing miserably to get it working. I changed the permissions on the upload folder to allow read/write too.
this is the script I am using
<?php
/* verifying my variables
print "$userfile = userfile <br>";
print "$userfile_name = userfile_name <br>";
print "$userfile_type = userfile_type <br>";
print "$userfile_size = userfile_size <br>";
print "$tmp_name = tmp_name <br>";
if (is_uploaded_file($HTTP_POST_FILES['userfile']['tmp_name'])) {
copy($HTTP_POST_FILES['userfile']['tmp_name'],
"/path/to/my/directory/that/I/want/files/uploaded");
} else {
echo "Possible file upload attack. Filename: " .
$HTTP_POST_FILES['userfile']['name'];
}
?>
results:
none = userfile
DataManagementSystemv1.05.mdb = userfile_name
application/msaccess = userfile_type
0 = userfile_size
= tmp_name
Possible file upload attack. Filename: DataManagementSystemv1.05.mdb
this is all created from a form.
<form ENCTYPE="multipart/form-data" action="upload.php" method=post>
<input type="hidden" name="MAX_FILE_SIZE" value="100000">
Upload this file: <input name="userfile" type="file">
<input type="submit" value="Send File">
</form>
Any suggestion why this doesnt work?
Thanks in advance
Michael