自制的超简易PHP网路硬盘
时间:2021-07-01 10:21:17
帮助过:20人阅读
PHP+HTML混写的超简易网络硬盘
- disk online
- 操作完 一下刷新
- /*
- * code written by mot
- * 2012 - 5 - 20
- *在根目录下面新建一个 名字为 x 的文件夹 存放上传文件
- */
- if(isset($_REQUEST['del'])){
- unlink($_REQUEST['del']);
- }
- set_time_limit(0);
- if(isset($_POST['button']))
- if(isset($_FILES['file'])){
- move_uploaded_file($_FILES['file']['tmp_name'], ".\\x\\".$_FILES['file']['name']);
- }
- ?>
-
-
文件名 | -
类型 | -
MD5 | -
大小 | -
操作 | -
- $hl = opendir(".\\x\\");
- while(false != $info = readdir($hl)){
- if($info == '.' || $info == '..') continue;
- $x[] = $info;
- }
- if(isset($x))
-
- foreach ($x as $file) {
- $type = explode('.', $file);
- $name = $type[0];
- $type = $type[1];
- $size = sprintf("%.2f",abs(filesize(".\\x\\".$file))/1024/1024);
- ?>
-
-
">=$name ?> | -
=$type ?> | -
=md5_file(".\\x\\".$file)?> | -
=$size." MB" ?> | -
">remove | -
- }
- ?>
|