I am having a problem with files uploaded in php. All uploaded files somehow double in size and become corrupt. I am using a clean install of RedHat8 with PHP-4.2.2 and httpd-2.0.40.
File smaller than about 2K get through ok, larger than that and the file is filled with duplicate information.
Any questions you have about this problem would be greatly appreciated. I'm stumped.
Here's is the test upload file I am using. The output is below. The actual file size is 31K.
<html>
<body>
<FORM method="post" enctype="multipart/form-data" action="<?php echo
$PHP_SELF; ?>" >
File : <INPUT type="File" name="the_file" />
<INPUT type="submit" name="the_submit" value="send file" />
</FORM>
<hr />
<pre>
<?php
$theFile = $HTTP_POST_FILES['userfile']['name'];
is_uploaded_file($theFile);
echo "_POST is: ";
print_r($_POST);
echo "<HR />\n_FILES is:";
print_r($_FILES);
?>
</pre>
</body>
</html>
the output:
_POST is: Array
(
[the_submit] => send file
)
_FILES is:Array
(
[the_file] => Array
(
[name] => atest.jpg
[type] => image/pjpeg
[tmp_name] => /tmp/php28YECb
[error] => 0
[size] => 63528
)