Home >php教程 >php手册 >[原创]php+ajax实现模拟Win文件管理系统十

[原创]php+ajax实现模拟Win文件管理系统十

WBOY
WBOYOriginal
2016-06-13 09:58:411096browse

 function Createfolder(){//创建文件夹


  document.getElementById('t').style.display='block';


 }

 function Copy(path,tage){//复制文件


  var time  = new Date();


  var filepath ="filepath";


  time.setTime(time.getTime()+60000);


  if(tage == 'c'){


   document.getElementById(path).style.filter = "Alpha(Opacity=50,style=0);";//设置透明度让用户感觉是文件被剪切了,


   path=path+"|";


   }


  document.cookie = filepath+"="+path+"; expires="+time.toGMTString()+"; path=/";//由于要用到全局变量所以用了cookie保存功能,


      


 }


 


 function Past(cookname,currentpath){//取得剪板中的文件 


  if(cookname == "" ){return false;}   


  var cookies  = document.cookie;


  if(cookies == ""){ alert("剪切贴为空!"); return false; }


  var arrar  = cookies.split("; ");


  for(var i=0;i


   if( arrar[i].indexOf(cookname)!= -1 ){


    returnvalue=arrar[i].split("=");


    Pastfile(returnvalue[1],currentpath);


   }


  }


  


 }


 


 function Pastfile(p_file,p_path){// 粘贴文件


  CreateAjax();


  var name=p_file.substring(p_file.lastIndexOf("/")+1);


  var url="rename.php?path="+encodeURI(p_path.replace("/","\/"))+"&nname="+name+"©path="+p_file+"&action=past&rd="+Math.random();


  Senddata('GET',url,Pastreturn,'');


  


 }


 


 function Pastreturn(){  


  if(xmlhttp.readystate == 4 || xmlhttp.status == 200){


   window.location.reload();


  }


 }


 

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