Hi,
i am having problem uploading.
1.
<html>
<body>
<form action="upload_file.php" method="post"
enctype="multipart/form-data">
<label for="file">Filename:</label>
<input type="file" name="file" id="file" />
<br />
<input type="submit" name="submit" value="Submit" />
</form>
</body>
</html>
2.
<?php
if ($_FILES["file"]["error"] > 0)
{
echo "Error: " . $_FILES["file"]["error"] . "<br />";
}
else
{
echo "Upload: " . $_FILES["file"]["name"] . "<br />";
echo "Type: " . $_FILES["file"]["type"] . "<br />";
echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb<br />";
echo "Stored in: " . $_FILES["file"]["tmp_name"];
}
?>
3. i can browse and upload the file. But i get below screen, when i click submit.
0)
{echo "Error: " . $_FILES["file"]["error"] ."
}
else
{
echo "Upload: " . $_FILES["file"]["name"] . "
echo "Type: " . $_FILES["file"]["type"] . "
echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb ";
echo "Stored in: " . $_FILES["file"]["tmp_name"];
}
I am new. Do i need to create a folder so attached file can be saved?
Thanks.