I changed the code with no luck...someone has got to know how to fix this. Here is the basic code right now:
<?php
if (!isset($changestatus)) {
?>
<form method="POST" action="<?=$PHP_SELF?>" enctype="multipart/form-data" />
<input name="userfile" type="file" />
<input name="changestatus" type="submit" value="SUMBIT" />
</form>
<?php
} else {
if ($userfile != "" || $userfile != NULL) {
echo("Error Code: " . $FILES['userfile']['error'] . "<br />");
echo("File Size: " . $FILES['userfile']['size'] . "<br />");
echo("MIME Type: " . $FILES['userfile']['type']);
move_uploaded_file($userfile, "/var/www/html/filelistings/" . $FILES['userfile']['name']);
echo("<br />Done");
}
}
?>
Now when I run it the file uploads fine, but the file size is about twice the size of the original file unless it is a plain/text file. .txt files work fine.
This is the output i get uploading a 156129 byte image:
In IE6:
Error Code: 0
Temp Name: /tmp/phpWzn1Gb
File Size: 311777
MIME Type: image/pjpeg
Done
In Mozilla:
Error Code: 0
Temp Name: /tmp/phpr9vlnL
File Size: 312405
MIME Type: image/jpeg
Done