Hi, everyone.
I want to use one form name is formUpload.html to test upload one file, and result get in result_upload_file.php are: name, type, size and where store about that file. But result is wrong.
There are my code:
formUpload.html
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title> Form upload file </title>
</head>
<body>
<form action="result_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>
result_upload_file.php
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title> Result upload file </title>
</head>
<body>
<?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"];
}
?>
</body>
</html>
report from system:
[ATTACH]15727[/ATTACH]
Could you tell me why the result is wrong?
Thank you.
p/s:
I store formUpload.html and result_upload_file.php in C:\AppServ\www
My appserv is:
[ATTACH]15729[/ATTACH]
The attachments of this post were removed during the platform migration in 2018