Hello....
I am encountering a problem while uploading images. I am using PHP-4.3 and apache 2.0.43. The uploaded image is always corrupted. The size of image also increases on uploading.
The code I am using is as follows:
upload.php
<html>
<body>
<form enctype="multipart/form-data" action="submit1.php" method="POST">
<table>
<tr>
<td>File to be uploaded</td>
<td><input type="file" name="img" value=""></td>
</tr>
<tr>
<td><input type="submit" value="Upload"></td>
</tr>
</table>
</form>
</body>
</html>
submit1.php
<html>
<body>
<?
$image = $HTTP_POST_FILES ["image"]["tmp_name"];
$image_name = $HTTP_POST_FILES ["image"]["name"];
if ($image != "") {
$dest = "upload";
$fname = $dest."/".$image_name;
move_uploaded_file($image,$fname)
or die ("couldnt copy file");
}
?>
I tried copy($image,$fname); also.
But the image is getting corrupted.
Can anybody help me......
--
Anjana