Web 在线文件管理器学习笔记与总结(2)显示文件列表(名称,类型,大小,可读,可写,可执行,创建时间,修改时间,访问时间)
主要函数:
filetype() 判断文件类型
filesize() 得到文件大小(字节)
is_readable() 判断文件是否可读
is_writeable() 判断文件是否可写
is_executable() 判断文件是否可执行
filectime() 文件创建时间
filemtime() 文件修改时间
fileatime() 文件访问时间
file.func.php 封装文件操作的文件:
<?php
/*
转换字节大小
*/
function transByte($size){
$arr = array('B','KB','MB','GB','TB','EB');
$i = 0;
while($size > 1024){
$size /= 1024;
$i++;
}
return round($size,2).' '.$arr[$i];
}
index.php:
<?php
require 'dir.func.php';
require 'file.func.php';
$path = 'file';
$info = readDirectory($path);
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<link rel="stylesheet" href="cikonss.css" />
<link rel="stylesheet" href="common.css" />
</head>
<body>
<h1>在线文件管理器</h1>
<div id="top">
<ul id="navi">
<li><a href="index.php" title="主目录"><span style="margin-left: 8px; margin-top: 0px; top: 4px;" class="icon icon-small icon-square"><span class="icon-home"></span></span></a></li>
<li><a href="#" title="新建文件" ><span style="margin-left: 8px; margin-top: 0px; top: 4px;" class="icon icon-small icon-square"><span class="icon-file"></span></span></a></li>
<li><a href="#" title="新建文件夹"><span style="margin-left: 8px; margin-top: 0px; top: 4px;" class="icon icon-small icon-square"><span class="icon-folder"></span></span></a></li>
<li><a href="#" title="上传文件"><span style="margin-left: 8px; margin-top: 0px; top: 4px;" class="icon icon-small icon-square"><span class="icon-upload"></span></span></a></li>
<li><a href="#" title="返回上级目录"><span style="margin-left: 8px; margin-top: 0px; top: 4px;" class="icon icon-small icon-square"><span class="icon-arrowLeft"></span></span></a></li>
</ul>
</div>
<table width='100%' border='1' cellpadding="5" cellspacing="0" bgcolor="#abcdef" align="center">
<tr align="center">
<td>编号</td>
<td>名称</td>
<td>类型</td>
<td>大小</td>
<td>可读</td>
<td>可写</td>
<td>可执行</td>
<td>创建时间</td>
<td>修改时间</td>
<td>访问时间</td>
<td>操作</td>
</tr>
<?php
if($info['file']){
$i = 1;
foreach($info['file'] as $val){
$p = $path.'/'.$val;
?>
<tr align="center">
<td><?php echo $i;?></td>
<td><?php echo $val;?></td>
<td><?php $src = filetype($p) == 'file'?'file_ico.png':'folder_ico.png';?><img src="data:images/<?php echo $src;?>" alt="" title='文件'></td>
<td><?php echo transByte(filesize($p));?></td>
<td><?php $src = is_readable($p)?'correct.png':'error.png';?><img src="data:images/<?php echo $src;?>" width="32" alt="" title='可读'></td>
<td><?php $src = is_writeable($p)?'correct.png':'error.png';?><img src="data:images/<?php echo $src;?>" width="32" alt="" title='可写'></td>
<td><?php $src = is_executable($p)?'correct.png':'error.png';?><img src="data:images/<?php echo $src;?>" width="32" alt="" title='可写'></td>
<td><?php echo date('Y-m-d H:i:s',filectime($p));?></td>
<td><?php echo date('Y-m-d H:i:s',filemtime($p));?></td>
<td><?php echo date('Y-m-d H:i:s',fileatime($p));?></td>
<td>
<a href="" title='查看'><img src="data:images/show.png" width="32" alt=""></a>
<a href="" title='修改'><img src="data:images/edit.png" width="32" alt=""></a>
<a href="" title='重命名'><img src="data:images/rename.png" width="32" alt=""></a>
<a href="" title='复制'><img src="data:images/copy.png" width="32" alt=""></a>
<a href="" title='剪切'><img src="data:images/cut.png" width="32" alt=""></a>
<a href="" title='删除'><img src="data:images/delete.png" width="32" alt=""></a>
<a href="" title='下载'><img src="data:images/download.png" width="32" alt=""></a>
</td>
</tr>
<?php
$i++;
}
}
?>
</table>
</body>
</html>
common.css:
body,p,div,ul,ol,table,dl,dd,dt{
margin:;
padding:;
}
a{
text-decoration: none;
}
ul,li{
list-style: none;
float: left;
}
#top{
width:100%;
height:48px;
margin:0 auto;
background: #E2E2E2;
}
#navi a{
display: block;
width:48px;
height: 48px;
}
#main{
margin:0 auto;
border:2px solid #ABCDEF;
}
.small{
width:25px;
height:25px;
border:;
}
cikonss.css:
/*
* Cikonss v1.0
*
* URL: https://github.com/zzap/Cikonss
* License: MIT License
*
*/ /* Generals */
.icon {
/* don't change width and height in order to change the size of the icon,
you can control the size with font-size for different class(es) - below */
line-height: 100%;
width: 1em;
height: 1em;
position: relative;
display: block;
float: left;
}
/* Button like icons */
.icon-square,
.icon-rounded {
border: .75em solid rgb(242, 242, 242); /* #f2f2f2 */
background-color: rgb(242, 242, 242); /* #f2f2f2 */
margin: 0 .5em .5em 0;
/* for browsers that supports */
-webkit-box-shadow: 0 0 0 .0625em rgb(226, 226, 226); /* #e2e2e2 */
-moz-box-shadow: 0 0 0 .0625em rgb(226, 226, 226); /* #e2e2e2 */
box-shadow: 0 0 0 .0625em rgb(226, 226, 226); /* #e2e2e2 */
}
.icon-rounded {
border-radius: 1.5em;
}
/*
* Sizes
*
* 5 preset sizes, simply change the font-size or add your custom class.
*
*/
.icon-small {
font-size: 1em;
}
.icon-mid {
font-size: 2em;
}
.icon-large {
font-size: 4em;
}
.icon-extra-large {
font-size: 8em;
}
.icon-huge {
font-size: 12em;
} /*
* Icons
*
* Icons are somewhat grouped so that you can easily pick the ones you like
* if the whole file is too large for your project.
*
*/ /* Home */
.icon-home {
position: absolute;
top:;
left: .125em;
width: .25em;
height: .5em;
background-color: rgb(102, 102, 102); /* #666 */
}
.icon-home:before,
.icon-home:after {
content: "";
position: absolute;
border-style: solid;
}
.icon-home:before {
top: .5em;
left:;
width: .25em;
height: .3125em;
border-width: .1875em .25em 0 .25em;
border-color: rgb(102, 102, 102); /* #666 */
}
.icon-home:after {
top: -.5em;
left: -.125em;
width:;
height:;
border-width: .5em;
border-color: transparent transparent rgb(102, 102, 102) transparent; /* #666 */
} /* Arrows */
.icon-arrowRight,
.icon-arrowLeft,
.icon-arrowDown,
.icon-arrowUp {
position: absolute;
width: .5em;
height: .5em;
background-color: rgb(102, 102, 102); /* #666 */
}
.icon-arrowRight:after,
.icon-arrowLeft:after,
.icon-arrowDown:after,
.icon-arrowUp:after {
content: "";
position: absolute;
width:;
height:;
border-width: .5em;
border-style: solid;
}
/* Arrows - Left and Right */
.icon-arrowRight,
.icon-arrowLeft {
top: .25em;
}
.icon-arrowRight {
left:;
}
.icon-arrowLeft {
right:;
}
.icon-arrowRight:after,
.icon-arrowLeft:after {
top: -.25em;
}
.icon-arrowRight:after {
left: .5em;
border-color: transparent transparent transparent rgb(102, 102, 102); /* #666 */
}
.icon-arrowLeft:after {
right: .5em;
border-color: transparent rgb(102, 102, 102) transparent transparent; /* #666 */
}
/* Arrows - Down and Up */
.icon-arrowDown,
.icon-arrowUp {
left: .25em;
}
.icon-arrowDown {
top:;
}
.icon-arrowUp,
.icon-arrowDown:after {
top: .5em;
}
.icon-arrowDown:after,
.icon-arrowUp:after {
left: -.25em;
}
.icon-arrowDown:after {
border-color: rgb(102, 102, 102) transparent transparent transparent; /* #666 */
}
.icon-arrowUp:after {
top: -1em;
border-color: transparent transparent rgb(102, 102, 102) transparent; /* #666 */
} /* Comments */
.icon-comment,
.icon-comment-text {
position: absolute;
top:;
left:;
width: 1em;
height: .75em;
background-color: rgb(102, 102, 102); /* #666 */
/* for browsers that supports */
border-radius: .125em;
}
.icon-comment:after,
.icon-comment-text:before,
.icon-comment-text:after {
content: "";
position: absolute;
border-style: solid;
}
.icon-comment-text:before {
top: .1875em;
left: .125em;
width: .75em;
height: .125em;
border-width: .09375em 0;
border-color: rgb(249, 249, 249); /* #f9f9f9 */
}
.icon-comment:after,
.icon-comment-text:after {
top: .75em;
left: .25em;
width:;
height:;
border-width: .125em;
border-color: rgb(102, 102, 102) transparent transparent rgb(102, 102, 102); /* #666 */
} /* Mail */
.icon-mail {
position: absolute;
top: .15625em;
left:;
width: 1em;
height: .75em;
background-color: rgb(102, 102, 102); /*#666*/
}
.icon-mail:before,
.icon-mail:after {
content: "";
position: absolute;
left:;
width:;
height:;
border-width: .4em .5em;
border-style: solid;
}
.icon-mail:before {
top:;
border-color: rgb(249, 249, 249) transparent transparent transparent; /* #f9f9f9 */
}
.icon-mail:after {
top: -.0625em;
border-color: rgb(102, 102, 102) transparent transparent transparent; /* #666 */
} /* Calendar */
.icon-calendar{
position: absolute;
top: .125em;
left:;
width: .875em;
height: .6875em;
border-width: .125em .0625em .0625em .0625em;
border-style: solid;
border-color: rgb(102, 102, 102); /* #666 */
background-color: rgb(249, 249, 249); /* #f9f9f9 */
/* for browsers that supports */
border-radius: .0625em;
}
.icon-calendar:before{
content: "";
position: absolute;
top: -.25em;
left: .125em;
width: .375em;
height: .125em;
border-width: 0 .125em;
border-style: solid;
border-color: rgb(102, 102, 102); /* #666 */
}
.icon-calendar:after{
content: "15";
position: absolute;
top: -.25em;
left: .25em;
font-family: Arial, sans-serif;
font-size: .5em;
font-weight: bold;
color: rgb(102, 102, 102); /* #666 */
} /* Plus */
.icon-plus,
.icon-plus:after {
position: absolute;
width: .375em;
height: .375em;
border-style: solid;
border-color: rgb(102, 102, 102); /* #666 */
}
.icon-plus {
top:;
left:;
border-width: 0 .25em .25em 0;
}
.icon-plus:after {
content: "";
top: .375em;
left: .375em;
border-width: .25em 0 0 .25em;
} /* Minus */
.icon-minus {
position: absolute;
top: .375em;
left:;
width: 1em;
height: .25em;
background-color: rgb(102, 102, 102); /* #666 */
} /* File */
.icon-file {
position: absolute;
top:;
left: .125em;
width: .5em;
height: .75em;
border-width: .125em;
border-style: solid;
border-color: rgb(102, 102, 102); /* #666 */
background-color: rgb(249, 249, 249); /* #f9f9f9 */
/* for browsers that supports */
border-radius: .0625em;
}
.icon-file:before {
content: "";
position: absolute;
top: -.125em;
left: -.125em;
width:;
height:;
border-width: .15625em;
border-style: solid;
border-color: rgb(255, 255, 255) rgb(102, 102, 102) rgb(102, 102, 102) rgb(255, 255, 255); /* #fff and #666 - #fff has to mach body bg*/
}
.icon-square .icon-file:before,
.icon-rounded .icon-file:before {
border-color: rgb(242, 242, 242) rgb(102, 102, 102) rgb(102, 102, 102) rgb(242, 242, 242); /* #f2f2f2 and #666 - #f2f2f2 has to mach with .icon-square and .icon-rounded bg*/
} /* Folder */
.icon-folder {
position: absolute;
top: .125em;
left:;
width: 1em;
height: .875em;
background-color: rgb(102, 102, 102); /* #666 */
/* for browsers that supports */
border-bottom-left-radius: .0625em;
border-bottom-right-radius: .0625em;
}
.icon-folder:before {
content: "";
position: absolute;
top: -.125em;
left: .125em;
width: .375em;
height: .125em;
background-color: rgb(102, 102, 102); /* #666 */
/* for browsers that supports */
border-top-left-radius: .0625em;
border-top-right-radius: .0625em;
} /* Tag */
.icon-tag {
position: absolute;
top:;
left: .25em;
width: .5em;
height: .75em;
background-color: rgb(102, 102, 102); /* #666 */
/* for browsers that supports */
border-top-left-radius: .0625em;
border-top-right-radius: .0625em;
}
.icon-tag:before,
.icon-tag:after {
content: "";
position: absolute;
top: .75em;
width:;
height:;
border-width: .125em;
border-style: solid;
}
.icon-tag:before {
left:;
border-color: rgb(102, 102, 102) transparent transparent rgb(102, 102, 102); /* #666 */
}
.icon-tag:after {
left: .25em;
border-color: rgb(102, 102, 102) rgb(102, 102, 102) transparent transparent; /* #666 */
} /* Desktop */
.icon-desktop {
position: absolute;
top:;
left:;
width: .875em;
height: .625em;
border-width: .0625em;
border-style: solid;
border-color: rgb(102, 102, 102); /* #666 */
background-color: rgb(249, 249, 249); /* #f9f9f9 */
/* for browsers that supports */
border-radius: .0625em;
}
.icon-desktop:before,
.icon-desktop:after {
content: "";
position: absolute;
background-color: rgb(102, 102, 102); /* #666 */
}
.icon-desktop:before {
top: .6875em;
left: .3125em;
width: .25em;
height: .1875em;
}
.icon-desktop:after {
top: .875em;
left: .125em;
width: .625em;
height: .0625em;
} /* Tablet */
.icon-tablet {
position: absolute;
top: .0625em;
left:;
width: .75em;
height: .625em;
border-width: .125em;
border-style: solid;
border-color: rgb(102, 102, 102); /* #666 */
background-color: rgb(249, 249, 249); /* #f9f9f9 */
/* for browsers that supports */
border-radius: .0625em;
}
.icon-tablet:before {
content: "";
position: absolute;
top: .28125em;
left: -.09375em;
width: .0625em;
height: .0625em;
background-color: rgb(255, 255, 255); /* #fff */
/* for browsers that supports */
border-radius: .0625em;
} /* Phone */
.icon-phone {
position: absolute;
top:;
left: .1875em;
width: .5em;
height: .75em;
border-width: .125em .0625em;
border-style: solid;
border-color: rgb(102, 102, 102); /* #666 */
background-color: rgb(249, 249, 249); /* #f9f9f9 */
/* for browsers that supports */
border-radius: .0625em;
}
.icon-phone:after {
content: "";
position: absolute;
top: .78125em;
left: .21875em;
width: .0625em;
height: .0625em;
background-color: rgb(255, 255, 255); /* #fff */
/* for browsers that supports */
border-radius: .0625em;
} /* Menu */
.icon-menu,
.icon-menu:before,
.icon-menu:after {
position: absolute;
left:;
width: 1em;
height: .25em;
background-color: rgb(102, 102, 102); /* #666 */
}
.icon-menu {
top: .0625em;
}
.icon-menu:before {
content: "";
top: .3125em;
}
.icon-menu:after {
content: "";
top: .625em;
} /* Download and Upload */
.icon-download,
.icon-upload {
position: absolute;
left: .375em;
width: .25em;
height: .5em;
background-color: rgb(102, 102, 102); /* #666 */
}
.icon-download {
top:;
}
.icon-upload {
top: .25em;
}
.icon-download:before,
.icon-upload:before {
content: "";
position: absolute;
left: -.125em;
width:;
height:;
border-width: .25em;
border-style: solid;
}
.icon-download:before {
top: .5em;
border-color: rgb(102, 102, 102) transparent transparent transparent; /* #666 */
}
.icon-upload:before {
top: -.5em;
border-color: transparent transparent rgb(102, 102, 102) transparent; /* #666 */
}
.icon-download:after,
.icon-upload:after {
content: "";
position: absolute;
left: -.375em;
width: .75em;
height: .125em;
border-width: 0 .125em .125em .125em;
border-style: solid;
border-color: rgb(102, 102, 102); /* #666 */
}
.icon-download:after {
top: .75em;
}
.icon-upload:after {
top: .5em;
} /* Page Templates */
.icon-tpl-full,
.icon-tpl-side-r,
.icon-tpl-side-l {
position: absolute;
top:;
left:;
width: 1em;
height: .25em;
background-color: rgb(102, 102, 102);
}
.icon-tpl-full:after,
.icon-tpl-side-r:before,
.icon-tpl-side-r:after,
.icon-tpl-side-l:before,
.icon-tpl-side-l:after {
content: "";
position: absolute;
top: .3125em;
height: .6875em;
background-color: rgb(102, 102, 102);
}
.icon-tpl-full:after,
.icon-tpl-side-r:before,
.icon-tpl-side-l:before {
left:;
}
.icon-tpl-full:after {
width: 1em;
}
.icon-tpl-side-r:before,
.icon-tpl-side-l:after {
width: .6875em;
}
.icon-tpl-side-r:after,
.icon-tpl-side-l:before {
width: .25em;
}
.icon-tpl-side-r:after {
left: .75em;
}
.icon-tpl-side-l:after {
left: .3125em;
} /* Views */
/* List view */
.icon-list-view,
.icon-list-view:before,
.icon-list-view:after {
position: absolute;
width: .0625em;
height: .25em;
border-width: 0 .6875em 0 .25em;
border-style: solid;
border-color: rgb(102, 102, 102);
}
.icon-list-view {
top: .0625em;
left:;
}
.icon-list-view:before,
.icon-list-view:after {
content: "";
left: -.25em;
}
.icon-list-view:before {
top: .3125em;
}
.icon-list-view:after {
top: .625em;
}
/* Grid view */
.icon-grid-view,
.icon-grid-view:before {
position: absolute;
width: .0625em;
height: .46875em;
border-width: 0 .46875em;
border-style: solid;
border-color: rgb(102, 102, 102);
}
.icon-grid-view {
top:;
left:;
}
.icon-grid-view:before {
content: "";
top: .53125em;
left: -.46875em;
} /* Camera */
.icon-camera {
position: absolute;
top: .25em;
left:;
width: .75em;
height: .5em;
background-color: rgb(102, 102, 102); /* #666 */
}
.icon-camera:after {
content: "";
position: absolute;
top:;
left: .5em;
width:;
height:;
border-width: .25em;
border-style: solid;
border-color: transparent rgb(102, 102, 102) transparent transparent; /* #666 */
} /* Image */
.icon-image {
position: absolute;
top: .125em;
left:;
width: .875em;
height: .625em;
border-width: .0625em;
border-style: solid;
border-color: rgb(102, 102, 102); /* #666 */
/* for browsers that supports */
border-radius: .0625em;
}
.icon-image:before,
.icon-image:after {
content: "";
position: absolute;
bottom:;
width:;
height:;
border-style: solid;
border-color: transparent transparent rgb(102, 102, 102) transparent; /* #666 */
}
.icon-image:before {
left:;
border-width: .25em .25em .125em .125em;
}
.icon-image:after {
right:;
border-width: .25em .25em .375em .375em;
} /* Player controls */
/* Play */
.icon-play {
position: absolute;
top:;
left: .1875em;
width:;
height:;
border-width: .5em .625em;
border-style: solid;
border-color: transparent transparent transparent rgb(102, 102, 102); /* #666 */
}
/* Stop */
.icon-stop {
position: absolute;
top: .0625em;
left: .0625em;
width: .875em;
height: .875em;
background-color: rgb(102, 102, 102); /* #666 */
}
/* Pause */
.icon-pause,
.icon-pause:after {
position: absolute;
width: .25em;
height: .875em;
background-color: rgb(102, 102, 102); /* #666 */
}
.icon-pause {
top: .0625em;
left: .21875em;
}
.icon-pause:after {
content: "";
top:;
left: .3125em;
}
/* Forward, Next, Rewind and Prev */
.icon-forward,
.icon-next,
.icon-rewind,
.icon-prev,
.icon-forward:after,
.icon-next:before,
.icon-rewind:after,
.icon-prev:before {
position: absolute;
width:;
height:;
border-width: .4375em;
border-style: solid;
}
.icon-forward,
.icon-next,
.icon-rewind,
.icon-prev {
top: .0625em;
}
.icon-forward:after,
.icon-next:before,
.icon-rewind:after,
.icon-prev:before,
.icon-next:after,
.icon-prev:after {
content: "";
top: -.4375em;
}
.icon-forward,
.icon-next,
.icon-forward:after,
.icon-next:before {
border-color: transparent transparent transparent rgb(102, 102, 102); /* #666 */
}
.icon-rewind,
.icon-prev,
.icon-rewind:after,
.icon-prev:before {
border-color: transparent rgb(102, 102, 102) transparent transparent; /* #666 */
}
.icon-forward {
left: .0625em;
}
.icon-rewind {
right: .0625em;
}
.icon-next,
.icon-forward:after,
.icon-next:before {
left:;
}
.icon-prev,
.icon-rewind:after,
.icon-prev:before {
right:;
}
.icon-next:after,
.icon-prev:after {
position: absolute;
width: .125em;
height: .875em;
background-color: rgb(102, 102, 102); /* #666 */
}
.icon-next:after {
left: .4375em;
}
.icon-prev:after {
right: .4375em;
} /* Stats */
.icon-stats,
.icon-stats:before {
position: absolute;
width: .3125em;
border-width: 0 .1875em;
border-style: solid;
border-color: rgb(102, 102, 102); /* #666 */
}
.icon-stats {
top:;
left:;
height: .875em;
}
.icon-stats:before {
content: "";
top: .3125em;
left: .0625em;
height: .5625em;
}
.icon-stats:after {
content: "";
position: absolute;
top: .875em;
left: -.1875em;
width: 1em;
height: .125em;
background-color: rgb(102, 102, 102); /* #666 */
} /* Battery */
.icon-battery-empty,
.icon-battery-1_4,
.icon-battery-half,
.icon-battery-3_4,
.icon-battery-full {
position: absolute;
top: .25em;
left:;
width: .75em;
height: .375em;
border-width: .0625em;
border-style: solid;
border-color: rgb(102, 102, 102); /* #666 */
background-color: rgb(249, 249, 249); /* #f9f9f9 */
}
.icon-battery-empty:after,
.icon-battery-1_4:after,
.icon-battery-half:after,
.icon-battery-3_4:after,
.icon-battery-full:after {
content: "";
position: absolute;
top: .0625em;
left: .8125em;
width: .125em;
height: .25em;
background-color: rgb(102, 102, 102); /* #666 */
}
.icon-battery-1_4:before,
.icon-battery-half:before,
.icon-battery-3_4:before,
.icon-battery-full:before {
content: "";
position: absolute;
top:;
left:;
height: .375em;
background-color: rgb(153, 153, 153); /* #999 */
}
.icon-battery-1_4:before {
width: .1875em;
}
.icon-battery-half:before {
width: .375em;
}
.icon-battery-3_4:before {
width: .5625em;
}
.icon-battery-full:before {
width: .75em;
} /* Sound */
.icon-sound-mute,
.icon-sound-normal,
.icon-sound-loud {
position: absolute;
top: .375em;
left: .09375em;
width: .25em;
height: .25em;
background-color: rgb(102, 102, 102);
}
.icon-sound-mute:before,
.icon-sound-normal:before,
.icon-sound-loud:before {
content: "";
position: absolute;
top: -.3125em;
left: -.3125em;
width: .375em;
height: .375em;
border-width: .25em;
border-style: solid;
border-color: transparent rgb(102, 102, 102) transparent transparent;
}
.icon-sound-normal:after,
.icon-sound-loud:after {
content: "";
position: absolute;
top: -.125em;
left: .625em;
width: .0625em;
height: .53125em;
border-style: solid;
border-color: rgb(102, 102, 102);
}
.icon-sound-normal:after {
border-width: 0 0 0 .0625em;
}
.icon-sound-loud:after {
border-width: 0 .0625em;
}
Web 在线文件管理器学习笔记与总结(2)显示文件列表(名称,类型,大小,可读,可写,可执行,创建时间,修改时间,访问时间)的更多相关文章
- Web 在线文件管理器学习笔记与总结(19)上传文件
dir.func.php 中添加方法: /* 上传文件 */ function uploadFile($fileInfo,$path,$allowExt = array('jpg','jpeg','p ...
- Web 在线文件管理器学习笔记与总结(17)复制文件 (18)剪切文件
(17)复制文件 ① 复制文件通过copy($src,$dst) 来实现 ② 检测目标目录是否存在,如果存在则继续检测目标目录中是否存在同名文件,如果不存在则复制成功 file.func.php 中添 ...
- Web 在线文件管理器学习笔记与总结(15)剪切文件夹 (16)删除文件夹
(15)剪切文件夹 ① 通过rename($oldname,$newname) 函数实现剪切文件夹的操作 ② 需要检测目标文件夹是否存在,如果存在还要检测目标目录中是否存在同名文件夹,如果不存在则剪切 ...
- Web 在线文件管理器学习笔记与总结(13)重命名文件夹(14)复制文件夹
(13)重命名文件夹 ① 重命名文件夹通过 rename($oldname,$newname) 实现 ② 检测文件夹名是否符合规范 ③ 检测当前目录中是否存在同名文件夹名称,如果不存在则重命名成功 i ...
- Web 在线文件管理器学习笔记与总结(11)获取文件夹信息 (12)返回上一级操作
(11)获取文件夹信息 文件夹没有修改操作. index.php: <?php require 'dir.func.php'; require 'file.func.php'; require ...
- Web 在线文件管理器学习笔记与总结(10)查看文件夹中的内容
① 读取文件夹大小 a. 封装计算文件夹大小的函数 b. 打开文件夹 c. 循环判断文件夹下的内容是文件还是文件夹,如果是文件,则累积相加文件的大小:如果是文件夹,则递归调用该函数 注意两个问题: ...
- Web 在线文件管理器学习笔记与总结(9)下载文件
① 普通形式的文件可以使用超链接形式下载 <a href = '下载文件名'>点击下载</a> ② 如果下载图片.html 等类型的文件,使用header() 函数发送网页头信 ...
- Web 在线文件管理器学习笔记与总结(8)删除文件
unlink($filename) 删除文件 index.php: <?php require 'dir.func.php'; require 'file.func.php'; require ...
- Web 在线文件管理器学习笔记与总结(7)重命名文件
rename($oldname,$newname) 重命名文件或目录 <<<EOF EOF; 使用heredoc 技术,来部分实现界面与代码的准分离 重命名时,需要验证新文件名的合法 ...
- Web 在线文件管理器学习笔记与总结(6)jQuery UI 预览图片
① 查看文件内容,如果文件是图片类型,点击直接查看图片: ② 如果不是图片类型,显示文件中的内容: ③ 使用 jQuery UI 中的 Dialog 显示图片 a.引入: <script src ...
随机推荐
- Android之自定义ViewGroup
概述 在写代码之前,我必须得问几个问题: 1.ViewGroup的职责是啥? ViewGroup相当于一个放置View的容器,并且我们在写布局xml的时候,会告诉容器(凡是以layout为开头的属性, ...
- linux rdsktop 运程管理 windows
[root@ok ISO]# yum list |grep rdesktop rdesktop.x86_64 1.7.1-1.el6 base [root@ok ISO]# yum install r ...
- jQuery Mobile 基础(第三章)
1.表单: 表单控件: 文本输入框 搜索输入框 单选按钮 复选框 选择菜单 滑动条 翻转拨动开关 fileld容器:如需让标签和表单元素看起来更适应宽屏,请用带有 data-role="fi ...
- Java Hour 27 Concurrent
有句名言,叫做10000小时成为某一个领域的专家.姑且不辩论这句话是否正确,让我们到达10000小时的时候再回头来看吧. 27 Hours. 本小时主要过一下多线程相关的基本API. Defining ...
- Struts2标签实现for循环
感悟:但是不建议使用这种方法,按照MVC框架的思想 ,应该把业务更多放在后台.前台尽量只进行数据展示. 转自:http://blog.csdn.net/guandajian/article/detai ...
- 编译x264 for ios
Tested with: x264-snapshot-20140914-2245 我用的是x264-snapshot-20150813-2245.tar.bz2 Xcode 7 依赖gas-prep ...
- TFS2012团队管理基本配置及基础使用方法
本文介绍如何在VS2012中使用微软提供的TFS2012服务器进行团队协作开发,免费默认只支持5用户,主要分为两大步服务器配置跟客户端配置. 转载请标注:http://www.kwstu.com/Ar ...
- 寒冰王座[HDU1248]
寒冰王座 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submis ...
- HDU 3065 (AC自动机模板题)
题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=3065 题目大意:多个模式串,范围是大写字母.匹配串的字符范围是(0~127).问匹配串中含有哪几种模 ...
- java中特殊的String类型
Java中String是一个特殊的包装类数据有两种创建形式: String s = "abc"; String s = new String("abc"); 第 ...