我试图分别使用以下两个文件html和php将文件上传到XAMPP for Mac
upload.html:
<pre>
<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>
upload_file.php:
<?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"];
}
?>
...服务器回答:
Upload: noname.gif
Type: image/gif
Size: 2.31640625 kB
Stored in: /Applications/XAMPP/xamppfiles/temp/phpjYIggr
我认为上传成功,因为我得到了上面的输出。但是,当我查看shell中phpjYIggr
的存储位置时,该文件不存在。
文件是否已删除?