Develop a file management system in php (with code)

angryTom
Release: 2023-04-08 08:38:01
forward
9373 people have browsed it

Develop a file management system in php (with code)

Rendering


  alert('读取失败');
  location.href='index.php';
  ");
}
//根据不同请求完成不同操作
switch($act){
  case 'createDir':
  // echo $dirName;exit;
  $res=create_dir($path.DIRECTORY_SEPARATOR.$dirName);
  if($res===true){
    $result['msg']=basename($dirName).'创建成功';
    $result['icon']=1;
  }else{
    $result['msg']=$res;
    $result['icon']=2;
  }
  exit(json_encode($result));
  break;
  case 'renameDir':
  $newName=$path.DIRECTORY_SEPARATOR.$dirName;
  $res=rename_dir($fileName,$newName);
  if($res===true){
    $result['msg']=$fileName.'重命名成功';
    $result['icon']=1;
  }else{
    $result['msg']=$res;
    $result['icon']=2;
  }
  exit(json_encode($result));
  break;
  case 'delDir':
  $res=del_dir($fileName);
  if($res===true){
    $result['msg']=basename($fileName).'删除成功';
    $result['icon']=1;
  }else{
    $result['msg']=$res;
    $result['icon']=2;
  }
  exit(json_encode($result));
  break;
  //文件部分
  case 'createFile':
  $res=create_file($path.DIRECTORY_SEPARATOR.$fileName);
  if($res===true){
    $result['msg']=basename($fileName).'文件新建成功';
    $result['icon']=1;
  }else{
    $result['msg']=$res;
    $result['icon']=2;
  }
  exit(json_encode($result));
  break;
  case 'showContents':
  $res=show_contents($fileName);
  exit($res);
  break;
}?>
  
    
    
    
    WEB在线文件管理器
    
    

    
    
    
  

WEB在线文件管理器

WEB在线文件管理器主要是用于管理项目文件,实现在线编辑、修改、删除等操作。

查看更多 »

类型 名称 读/写/执行 访问时间 操作
打开 &path=' data-showName=''>重命名 剪切 复制 &path=' data-showName=''>删除
查看 编辑 下载 重命名 剪切 复制 删除

Copy after login

Directory function file dir.func.php

Copy after login

File function file.func.php

";
  }else{    $str=file_get_contents($fileName);    if(strlen($str)>0){      $res=highlight_string($str,true);
    }else{      $res='文件中没有内容';
    }
  }  return $res;
}
Copy after login

This article comes from the php Chinese website, php tutorial column, welcome to learn!

The above is the detailed content of Develop a file management system in php (with code). For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:cnblogs.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact [email protected]
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!