📄 wm.sys_ftp.asp
字号:
<!--#include file="WM.Sys_Cook.asp"-->
<%
If CheckAdminFlag("") = False Then Call WRMPS.ErrView("·您没有权限进行此操作",0)
If Not WEBFTP Then Call WRMPS.ErrView("·WEBFTP功能已设置为不启用状态",1)
Response.Buffer = True
Response.Expires = -1
Response.ExpiresAbsolute = Now() - 1
Response.Expires = 0
Response.CacheControl = "no-cache"
%>
<style>
A {COLOR: #000000; TEXT-DECORATION: None}
A:link {COLOR: #000000; TEXT-DECORATION: None}
A:visited{COLOR: #000000; TEXT-DECORATION: None}
A:hover {COLOR: #000000; TEXT-DECORATION: None}
A:active {TEXT-DECORATION: none}
.div {background:#ffffff;FONT-SIZE: 12px;BORDER: #333333 1px solid}
</style>
<script language=javascript>
var imgheight
document.ns = navigator.appName == "Netscape"
window.screen.width>800 ? imgheight=410:imgheight=430
function myload(){
if (navigator.appName == "Netscape"){
document.dangdang.pageY=pageYOffset+window.innerHeight-imgheight;
document.dangdang.pageX=+window.innerWidth-220;
mymove();
}else{
dangdang.style.top=document.body.scrollTop+58;
dangdang.style.left=document.body.offsetWidth-220;
mymove();
}
}
function mymove(){
if(document.ns){
document.dangdang.top=pageYOffset+window.innerHeight-imgheight;
document.dangdang.left=pageXOffset+window.innerWidth-220;
setTimeout("mymove();",80)
}else{
dangdang.style.top=document.body.scrollTop+58;
dangdang.style.left=document.body.scrollLeft+document.body.offsetWidth-220;
setTimeout("mymove();",80)
}
}
function MM_reloadPage(init) {if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();}
MM_reloadPage(true)
if (navigator.appName == "Netscape"){
document.write("<layer id=dangdang top=300 width=200 height=390><table class=div width=200px border=0 cellspacing=0 cellpadding=0><tr><td id=s align=center height=260><Img src=img/nopic.gif></td></tr><tr><td id=sf height=130 style='padding:0 0 0 10px'></td></tr></table></layer>");
myload()
}else{
document.write("<div id=dangdang style='position: absolute;width:200;visibility: visible;z-index: 1'><table class=div width=200px border=0 cellspacing=0 cellpadding=0><tr><td id=s align=center height=260><Img src=img/nopic.gif></td></tr><tr><td id=sf height=130 style='padding:0 0 0 10px'></td></tr></table></div>");
myload()}
var tID="";
function show(filenum,src,ID,aa,bb,cc,dd,ee,ff){
s.innerHTML="<Img src="+src+" width=190 onload=\'DrawImage(this, 190, 250);\' onclick=window.open(this.src,'_n') style='cursor:pointer'>";
if(ID!=tID){
if (tID!=""){
document.getElementById(tID).style.backgroundColor="";
document.getElementById(tID).style.color="#000000";
}
document.getElementById(ID).style.backgroundColor="#0A246A";
document.getElementById(ID).style.color="#FFFFFF";
tID=ID;
}
sf.innerHTML = "名称:"+aa+"<br>类型:"+bb+"文件<br>大小:"+cc+"<br>创建时间:"+dd+"<br>最后更新:"+ee+"<br>最后访问:"+ff;
}
//设定图片显示尺寸
var flag=false;
function DrawImage(ImgD,w,h){
var image=new Image();
image.src=ImgD.src;
if(image.width>0 && image.height>0){
flag=true;
if(image.width/image.height>= w/h){
if(image.width>w){
ImgD.width=w;
ImgD.height=(image.height*w)/image.width;
}else{
ImgD.width=image.width;
ImgD.height=image.height;
}
}
else{
if(image.height>h){
ImgD.height=h;
ImgD.width=(image.width*h)/image.height;
}else{
ImgD.width=image.width;
ImgD.height=image.height;
}
}
}
}
</script>
<%
Call WM_Content
Function GetPath(str)
GetPath = WRMPS.GetReplace(str," ","_")
GetPath = WRMPS.GetReplace(GetPath,"\","/")
End Function
Sub WM_Content()
Dim UploadFiles
Dim sCurrDir, sDir
Dim sFileName, sMapFileName, oFolder, oFiles, oFile
Dim sFolderName, sMapFolderName
Dim oUploadFolder, oUploadFiles, oUploadFile
Dim oSubFolder
Dim sF,sFilter,sPic
Dim w_Ext,w_Path,i,n,w_NewPath
Dim w_Content
w_Ext = Request("Ext")
w_Path = Request("Path")
'初始值
sCurrDir = WR_Setting(3) '设定根目录
Call WRMPS.FsoBegin()
sDir = Trim(Request("dir"))
If sDir <> "" Then
If WRMPS.FsoIsTrue("Dir",sCurrDir & sDir) = True Then
sCurrDir = sCurrDir & sDir & "/"
Else
sCurrDir = ""
End If
End If
If sCurrDir = "" Then Exit Sub
URLParameter = "dir=" & sDir
Response.Write "<table width='100%' cellpadding=3 cellspacing=1 class=td1>" & vbCrLf
Response.Write "<tr Class=td4><td colspan=2><strong><a href=?>FTP首页</a> | <a href=?"&URLParameter&"&Action=Cre&Ext=File>创建文件</a> | <a href=?"&URLParameter&"&Action=Cre&Ext=Folder>创建文件夹</a> | <a href=?"&URLParameter&"&Action=UpLoad>上传文件</a></strong></td></tr>" & vbCrLf
Response.Write "<form name='form' method='get'><tr><td colspan=2>"
Response.Write "<select name=dir onChange='javascript:submit()' style=""width:100%"">" & vbCrLf
Dim D_V,D_S,D_D
D_D = "<option value=''>FTP:\</option>" & vbCrLf
For i = 0 To Ubound(Split(sCurrDir,"/"))
If Split(sCurrDir,"/")(i) <> "" Then
If i > 0 Then
If D_V = "" Then D_V = Split(sCurrDir,"/")(i) Else D_V = D_V&"/"&Split(sCurrDir,"/")(i)
End If
D_S = D_S&"\"&Split(sCurrDir,"/")(i)
D_D = "<option value='"&D_V&"'>FTP:"&D_S&"</option>" & vbCrLf & D_D
End If
Next
Response.Write D_D&"</select>" & vbCrLf
Response.Write "</td></tr></form>"
Response.Write "<tr><td valign=top>" & vbCrLf
Select Case Request("Action")
Case "UpLoad"
Response.Write "<table width='100%' cellpadding=3 cellspacing=1 class=td1>" & vbCrLf
Response.Write "<form name='form1' action='?"&URLParameter&"&Action=SaveUpFiles' method=""post"" enctype=""multipart/form-data"">"
Response.Write "<tr Class=td2><td width='20%'><strong>文件01</strong></td><td width='80%'><input class=""input"" type=""FILE"" value="""" name=""FILE1"" size=""30""></td></tr>" & vbCrLf
Response.Write "<tr Class=td2><td><strong>文件02</strong></td><td><input class=""input"" type=""FILE"" value="""" name=""FILE2"" size=""30""></td></tr>" & vbCrLf
Response.Write "<tr Class=td2><td><strong>文件03</strong></td><td><input class=""input"" type=""FILE"" value="""" name=""FILE3"" size=""30""></td></tr>" & vbCrLf
Response.Write "<tr Class=td2><td><strong>文件04</strong></td><td><input class=""input"" type=""FILE"" value="""" name=""FILE4"" size=""30""></td></tr>" & vbCrLf
Response.Write "<tr Class=td2><td><strong>文件05</strong></td><td><input class=""input"" type=""FILE"" value="""" name=""FILE5"" size=""30""></td></tr>" & vbCrLf
Response.Write "<tr Class=td2><td><strong>文件06</strong></td><td><input class=""input"" type=""FILE"" value="""" name=""FILE6"" size=""30""></td></tr>" & vbCrLf
Response.Write "<tr Class=td2><td><strong>文件07</strong></td><td><input class=""input"" type=""FILE"" value="""" name=""FILE7"" size=""30""></td></tr>" & vbCrLf
Response.Write "<tr Class=td2><td><strong>文件08</strong></td><td><input class=""input"" type=""FILE"" value="""" name=""FILE8"" size=""30""></td></tr>" & vbCrLf
Response.Write "<tr Class=td2><td><strong>文件09</strong></td><td><input class=""input"" type=""FILE"" value="""" name=""FILE9"" size=""30""></td></tr>" & vbCrLf
Response.Write "<tr Class=td2><td><strong>文件10</strong></td><td><input class=""input"" type=""FILE"" value="""" name=""FILE10"" size=""30""></td></tr>" & vbCrLf
Response.Write "<tr Class=td2><td></td><td><input type=submit name='Submit' value='上 传'> <input type='button' name='Submit' value='返 回' Onclick=""javascript:history.back()""></td></tr>" & vbCrLf
Response.Write "</form>" & vbCrLf
Response.Write "</table>" & vbCrLf
Case "SaveUpFiles"
Dim foldername,upfile_empty,intTemp,formName
foldername = sCurrDir
If Right(foldername,1) = "/" Then foldername = Left(foldername,Len(foldername)-1)
if foldername="/" or foldername="./" then foldername="./" Else foldername=foldername&"/"
Dim Uploader, File
upfile_empty=true
Set Uploader = New UpLoadClass
Uploader.FileType="*.*"
Uploader.MaxSize=104857600 '100M
Uploader.SavePath=foldername
Uploader.AutoSave = 2
Uploader.open()
for intTemp=1 to Ubound(Uploader.FileItem)
formName=Uploader.FileItem(intTemp)
Call Uploader.Save(formName,1)
If Uploader.form(formName&"_Err")<>-1 Then upfile_empty=false
next
If upfile_empty Then
errornum = errornum+1
errorcode = errorcode & "<li>还没有选择任何上传的文件</li>"
Exit Sub
End If
Response.Redirect "?"&URLParameter
Case "CreFolder"
If w_Path <> "" Then
WRMPS.CreFolder sCurrDir&GetPath(w_Path)
End If
Response.Redirect "?"&URLParameter
Case "CreFile"
If w_Path <> "" Then
w_Content = Request.Form("Content")
WRMPS.CreateFile sCurrDir&GetPath(w_Path),w_Content
End If
Response.Redirect "?"&URLParameter
Case "Edit"
Select Case w_Ext
Case "htm", "asp", "txt", "inc", "html", "shtml", "shtm", "js", "css", "asa", "aspx"
Response.Write "<table width='100%' cellpadding=3 cellspacing=1 class=td1>" & vbCrLf
Response.Write "<form name='form1' method='post' action='?"&URLParameter&"&Action=CreFile'>" & vbCrLf
Response.Write "<tr Class=td2><td width='20%'><strong>文件名称</strong></td><td width='80%'><input type='text' name='Path' value='"&w_Path&"' readonly></td></tr>" & vbCrLf
Response.Write "<tr Class=td2><td><strong>文件内容</strong></td><td><textarea name='Content' cols='70' rows='20' wrap=OFF>"&WRMPS.GetHtmlEncode(WRMPS.GetHtml(sCurrDir&w_Path))&"</textarea></td></tr>" & vbCrLf
Response.Write "<tr Class=td2><td></td><td><input type=submit name='Submit' value='保 存'> <input type='button' name='Submit' value='返 回' Onclick=""javascript:history.back()""></td></tr>" & vbCrLf
Response.Write "</form>" & vbCrLf
Response.Write "</table>" & vbCrLf
Case Else
Response.Write "<table width='100%' cellpadding=3 cellspacing=1 class=td1>" & vbCrLf
Response.Write "<tr Class=td2><td height=100px align=center><strong>在线编辑功能暂不支持此格式文件</strong><p><input type='button' name='Submit' value='返 回' Onclick=""javascript:history.back()""></td></tr>" & vbCrLf
Response.Write "</table>" & vbCrLf
End Select
Case "Cre"
If w_Ext <> "File" Then
Response.Write "<table width='100%' cellpadding=3 cellspacing=1 class=td1>" & vbCrLf
Response.Write "<form name='form1' method='post' action='?"&URLParameter&"&Action=CreFolder'>" & vbCrLf
Response.Write "<tr Class=td2><td width='20%'><strong>文件夹名称</strong></td><td width='80%'><input type='text' name='Path'></td></tr>" & vbCrLf
Response.Write "<tr Class=td2><td></td><td><input type=submit name='Submit' value='创 建'> <input type='button' name='Submit' value='返 回' Onclick=""javascript:history.back()""></td></tr>" & vbCrLf
Response.Write "</form>" & vbCrLf
Response.Write "</table>" & vbCrLf
Else
Response.Write "<table width='100%' cellpadding=3 cellspacing=1 class=td1>" & vbCrLf
Response.Write "<form name='form1' method='post' action='?"&URLParameter&"&Action=CreFile'>" & vbCrLf
Response.Write "<tr Class=td2><td width='20%'><strong>文件名称</strong></td><td width='80%'><input type='text' name='Path'></td></tr>" & vbCrLf
Response.Write "<tr Class=td2><td><strong>文件内容</strong></td><td><textarea name='Content' cols='70' rows='20'></textarea></td></tr>" & vbCrLf
Response.Write "<tr Class=td2><td></td><td><input type=submit name='Submit' value='创 建'> <input type='button' name='Submit' value='返 回' Onclick=""javascript:history.back()""></td></tr>" & vbCrLf
Response.Write "</form>" & vbCrLf
Response.Write "</table>" & vbCrLf
End If
Case "EditFolder"
w_NewPath = Request("NewPath")
w_NewPath = GetPath(WRMPS.GetReplace(w_NewPath,"/",""))
If w_NewPath <> "" Then
If WRMPS.FsoIsTrue("Dir",sCurrDir&w_NewPath) = True Then
Response.Write "<table width='100%' cellpadding=3 cellspacing=1 class=td1>" & vbCrLf
Response.Write "<tr Class=td2><td height=100px align=center><strong>新文件夹名已经存在</strong><p><input type='button' name='Submit' value='返 回' Onclick=""javascript:history.back()""></td></tr>" & vbCrLf
Response.Write "</table>" & vbCrLf
Else
Fso.MoveFolder Server.MapPath(sCurrDir&w_Path),Server.MapPath(sCurrDir&w_NewPath)
Response.Redirect "?"&URLParameter
End If
Else
Response.Redirect "?"&URLParameter
End If
Case "EditFile"
w_NewPath = Request("NewPath")
w_NewPath = GetPath(WRMPS.GetReplace(w_NewPath,"/",""))
If w_NewPath <> "" Then
If WRMPS.FsoIsTrue("File",sCurrDir&w_NewPath) = True Then
Response.Write "<table width='100%' cellpadding=3 cellspacing=1 class=td1>" & vbCrLf
Response.Write "<tr Class=td2><td height=100px align=center><strong>新文件名已经存在</strong><p><input type='button' name='Submit' value='返 回' Onclick=""javascript:history.back()""></td></tr>" & vbCrLf
Response.Write "</table>" & vbCrLf
Else
Fso.MoveFile Server.MapPath(sCurrDir&w_Path),Server.MapPath(sCurrDir&w_NewPath)
Response.Redirect "?"&URLParameter
End If
Else
Response.Redirect "?"&URLParameter
End If
Case "EditName"
If w_Ext <> "File" Then
Response.Write "<table width='100%' cellpadding=3 cellspacing=1 class=td1>" & vbCrLf
Response.Write "<form name='form1' method='post' action='?"&URLParameter&"&Action=EditFolder'>" & vbCrLf
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -