Home  >  Article  >  php教程  >  php防dedecms附件式文件在线管理系统(1/6)

php防dedecms附件式文件在线管理系统(1/6)

WBOY
WBOYOriginal
2016-06-13 11:23:56995browse

php教程防dedecms附件式文件在线管理系统
  使用方法:
     1。先在根目录建立uploadfile目录
     2。“值”与“图”:这是用于将此图片传到父窗口的。值,传的是文件名,可用于input;图,传的是图片,用于编辑器。在使用此功能时,先将“值”前面的文本框填写父窗口的ID值。我在用层弹出本程序时可正常赋值。
     3。可多个文件上传,如果目标目录有相同的文件,则重命名为“文件名(n).jpg",和FCKeditor一样的命名方式
  测试环境:apache2.2.14 + PHP5.3 + windowswww.bkjia.com
*/

header("Content-type: text/html; charset=UTF-8");
define("ROOT",str_ireplace('/waityou/'.basename(__FILE__),'',str_ireplace("","/",__FILE__)));
define("UploadFolder","/uploadfile/");//上传根目录
define("_d",$_SERVER['DOCUMENT_ROOT']);
define("AllowUploadType","gif|jpg|png|txt|doc|xls|ppt|pdf|rar|zip|7z|chm|mp3|mp4|mpg|mpeg|flv|swf");//允许上传的类型
define("MaxUploadSize",@ini_get('upload_max_filesize'));


$act = empty($_GET['act'])?'':$_GET['act'];

if($act == ""){
   html_header();
}elseif($act == 'left'){
   left();
}elseif($act == 'right'){
   if(!empty($_POST['upfolder'])) {
     upload_file();exit;
   }

   $dir = empty($_GET['folder'])?'':$_GET['folder'];
   if($dir == ''){
      right(UploadFolder);
   }else{
     $del_file = empty($_GET['del_file'])?'':$_GET['del_file'];
     if($del_file == '') {
        open_folder($dir);
     }else{
        delete_file($del_file);
     }
   }
}

1 2 3 4 5 6

Statement:
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 admin@php.cn