From 2d91dd0ff2ca43ff21eec6163205fbd69725f8d1 Mon Sep 17 00:00:00 2001 From: NriotHrreion Date: Sun, 20 Feb 2022 21:17:46 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=AF=B9=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=A4=A7=E5=B0=8F=E7=9A=84=E6=A3=80=E6=9F=A5,=20=E8=BF=87?= =?UTF-8?q?=E6=BB=A4=E7=A9=BA=E5=8D=A0=E4=BD=8D=E7=AC=A6(Array)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- upload/index.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/upload/index.php b/upload/index.php index 07a0b02..381aac8 100644 --- a/upload/index.php +++ b/upload/index.php @@ -124,10 +124,13 @@ while (($f1 = readdir($handler)) !== false) { closedir($handler); //打印所有文件名 $files[] = []; -//空占位符,不知道怎么处理,先这样吧! + foreach ($files as $filename) {//删除文件就这样吧!虽然bug,啊哈哈! $path = $dir.$filename;//文件存储位置 $file_number = @filesize($path); //获取文件大小 + +//检查文件大小是否为0 +if($file_number != 0) { $file_number_to_mb = round($file_number / (1024*1024),5);//单位换算 $creat_time = @filectime($path);//获取时间 //---------------------- @@ -152,7 +155,7 @@ $date = date("Y-m-d H:i:s",$creat_time);//变量存储 //版权所有,侵权必究 //copyright (C) 2022 pengzekai //---------------------- - +} } } ?> -- Gitee