Hi. this is my php code from the form sending called, index.php
[CODE]
<body>
<form method=”POST” action=”upload.php” enctype=”multipart/form-data”>
<h2>Upload your image here</h2>
<input type=”file” name=”img”/><br />
<input type=”submit” name=”upload” value=”Upload” />
</form>
</body>
and this is my uploded code on uploaded.php
[CODE]
<?php
$name = $_FILES[‘img’][‘name’];
$type = $_FILES[‘img’][‘type’];
$size = $_FILES[‘img’][‘size’];
$temp = $_FILES[‘img’][‘tmp_name’];
$error = $_FILES[‘img’][‘error’];
if($error > 0)
{
die(‘File did not upload’ . $error);
}
else
{
move_uploaded_file($temp, ‘uploaded/’ . $name);
echo “Image uploaded successfully”;
}
?>
[B]Question:
The problem is that when the image is successfully uploaded so it appears in the uploaded folder with valid file name, size and type but when i click on it so it does not show the image, rather the image is being appeared with an error message that:
[QUOTE]
Windows Photo viewer can’t open this picture, because you don’t have the correct permissions to access the file location
Not only with images, i also uploaded a video and it has also valid name, size and type but it can’t be played. VLC player gives error.
[B]Note:
I’m using Appserv instead of xamp or wamp etc.
Please guide me that is there anything wrong in my code?