0
看完後this我覺得我的上傳腳本有一個進度條(已經完成並正在工作),我嘗試了一下,但我不是很熟練,我也做不到。這裏是我的upload.php
腳本:如何在PHP中獲得進度條?
if (isset($_FILES['files_to_upload'])){
//some checks
if(is_uploaded_file($_FILES['files_to_upload']['tmp_name']))
{
if (move_uploaded_file($_FILES['files_to_upload']['tmp_name'] , '/mnt/uploads' . $_FILES['files_to_upload']['name'])){
echo '<script>alert("' . $_FILES['files_to_upload']['name'] . ' uploaded!")</script>';
}
}
,在這裏我的HTML:
<html>
<body>
<form action="upload.php" method="post" enctype="multipart/form-data">
<input type="file" name="files_to_upload">
<input type="submit" value="upload">
</form>
</body>
</html>
誰能照亮了我如何可以實現一個進度條,好嗎?