我想使用文件上传进度。任何人都可以提供可能的简单代码来显示上传进度条。在下一个代码上。有文件接收文件upload.php
<?php
if ($_FILES) {
foreach ($_FILES as $k => $v) {
if ($v["error"] > 0) {
echo "Error: " . $_FILES["file"]["error"] . "<br>";
} else {
echo "Upload: " . $v["name"] . "<br>";
echo "Type: " . $v["type"] . "<br>";
echo "Size: " . ($v["size"] / 1024) . " kB<br>";
echo "Stored in: " . $v["tmp_name"]. "<br><br>";
}
}
return;
}
?>
还有一个带有文件上传表单的html。
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Upload</title>
</head>
<body>
<form action="upload.php" method="post" enctype="multipart/form-data">
<label for="f1">Filename:</label>
<input type="file" name="f1" id="f1"><br>
<label for="f2">Filename:</label>
<input type="file" name="f2" id="f2"><br>
<input type="submit" name="submit" value="Submit">
</form>
</body>
</html>
谢谢