I got a trouble. The code showned below working fine in PHP4.2.2 on RedHat 7.3 environment but doesn't work with PHP4.2.2 on RedHat 8.0. When I tryed to upload JPG files bigger then 3Kb the upload doesn't fail but the uploaded file is corupted (the size increase with about 80% and the image is distorsioned)
I supose that some settings from php.ini or/and httpd.conf are wrong.
Can somebody help me?
Thanks!
nelutu@zalau.astral.ro
<form enctype="multipart/form-data" method="post">
<input type="hidden" name="MAX_FILE_SIZE" value="100000">
Send this file: <input name="userfile" type="file">
<input type="submit" name="send" value="Send">
<input type="hidden" name="MAX_FILE_SIZE" value="102400">
<?php
if ($send=="Send"){
$pic_name="aimages/test.jpg";
@unlink($pic_name);
if (move_uploaded_file($userfile,$pic_name)){$text="$pic_name uploaded.";}
else {$text="Fail!!!";}
echo "$text<BR>";
}
?>
</form>