上传: 改名:
read()) { //计算文件大小和创建时间 if ($file != "." && $file != ".." && !is_dir("$inpath/$file")) { $filesize = filesize("$inpath/$file"); $filesize = $filesize / 1024; if ($filesize != "") if ($filesize < 0.1) { @list($ty1, $ty2) = split("\.", $filesize); $filesize = $ty1.".".substr($ty2, 0, 2); } else { @list($ty1, $ty2) = split("\.", $filesize); $filesize = $ty1.".".substr($ty2, 0, 1); } $filetime = filemtime("$inpath/$file"); $filetime = MyDate("Y-m-d H:i", $filetime); } //判断文件类型并作处理 if ($file == ".") continue; else if ($file == "..") { if ($activepath == "") continue; $tmp = preg_replace("#[\/][^\/]*$#i", "", $activepath); $line = "\r\n"; echo $line; } else if (is_dir("$inpath/$file")) { if (preg_match("#^_(.*)$#i", $file)) continue; if (preg_match("#^\.(.*)$#i", $file)) continue; $line = ""; echo "$line"; } else if (preg_match("#\.(zip|rar|tgr.gz)#i", $file)) { if ($file == $comeback) $lstyle = " style='color:#dc3545' "; else $lstyle = ""; $reurl = "$activeurl/$file"; $reurl = preg_replace("#^\.\.#", "", $reurl); $reurl = $reurl; $line = ""; echo "$line"; } else { if ($file == $comeback) $lstyle = " style='color:#dc3545' "; else $lstyle = ''; $reurl = "$activeurl/$file"; $reurl = preg_replace("#^\.\.#", "", $reurl); $reurl = $reurl; $line = ""; echo "$line"; } }//End Loop $dh->close(); ?>
选择文件 文件大小 修改时间
上级目录 当前目录:$activepath
$file
$file $filesize KB $filetime
$file $filesize KB $filetime
点击选择的文件,红色字样的为刚上传的文件