ASP+FSO online Management picture features [Original]_ application Tips

Source: Internet
Author: User
Tags servervariables
Copy Code code as follows:

<%
'---------------------------------------------
' ############# #20060528新增加了对端口的支持
' Author: DXY qq:461478385 email:douxy001@gmail.com
' Function perfect
%>
<!--#include file= "global.asp"-->
<!--#include file= "session.asp"-->
<%
Set myfile=server.createobject ("Scripting.FileSystemObject")
If Request.Form ("action") = "Delall" Then
Num=request.form ("Delfilename"). Count
For X=1 to Num
Thedelall=server.mappath (".. /upload/"&request.form (" Delfilename ") (x))
If Myfile.fileexists (Thedelall) Then
Myfile.deletefile (Thedelall)
End If
Next
End If
Page=cint (Request.QueryString ("page"))
If Page<=1 or page= "" then page=1
Pagesize=25
Domain=request.servervariables ("SERVER_NAME")
Gfilepath=request.servervariables ("Path_info")
Serverport=request. ServerVariables ("Server_port")
Gfilepath=lcase (Left (Gfilepath,instrrev (Gfilepath, "/"))
Countn=len (Gfilepath)
Gfilepath=lcase (Left (gfilepath,countn-1))
Gfilepath=lcase (Left (Gfilepath,instrrev (Gfilepath, "/"))
If serverport<> "then"
Allpath= "http://" &Domain& ":" &serverport&gfilepath
Else
Allpath= "http://" &domain&gfilepath
End If
Filepath= ". /upload/"
Dim fso
Set Fso=server. CreateObject ("Scripting.FileSystemObject")
Set Thefolder=fso.getfolder (server. MapPath (filepath))
For each ffiles in Thefolder.files
Filecounts=filecounts+1
Filesizes=filesizes+ffiles.size
If Filesizes=0 Then
Response.Write "There is no content under this folder"
Response.End
End If
Next

%>
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 "/>
&LT;TITLE&GT;DXY File Manager </title>
<link href= "Main.css" rel= "stylesheet" type= "Text/css"/>
<script language= "javascript" type= "Text/javascript" >
function Checkall ()
{
for (Var ic=0;ic<form1.delfilename.length;ic++)
{
var e = Form1.delfilename[ic];
e.checked =!e.checked;
}
}
</script>

<body style= "margin:0px;" >
<table width= "760" border= "0" align= "center" cellpadding= "3" cellspacing= "1" bgcolor= "#1F429E" >
<form action= "" method= "Post" Name= "Form1" ><tr>
&LT;TD width= "height=" bgcolor= "#FFFFFF" ><div align= "center" > Serial number </div></td>
&LT;TD width= "493" height= "bgcolor=" #FFFFFF "><div align=" center "> FileName </div></td>
&LT;TD width= bgcolor= "#FFFFFF" ><div align= "Center" > File size </div></td>
&LT;TD width= "bgcolor=" "#FFFFFF" ><div align= "center" > Selection </div></td>
</tr>
<%
I=0
For each ffiles in Thefolder.files
I=i+1
If Ccount>=pagesize Then
Exit For
ElseIf i>pagesize* (page-1) Then
Ccount=ccount+1
%>
<tr>
&LT;TD height= "nowrap=" nowrap bgcolor= "#FFFFFF" align= "center" ><%=i%></td>
&LT;TD nowrap= "nowrap" bgcolor= "#FFFFFF" ><a href= "<%=allpath&" upload/"&ffiles.name%>" target= " _blank "> border=" 0 "/></a></td>
&LT;TD nowrap= "nowrap" bgcolor= "#FFFFFF" ><div align= "center" ><%=ffiles.size%>[bytes]</div></ Td>
&LT;TD nowrap= "nowrap" bgcolor= "#FFFFFF" >
<div align= "center" >
<input name= "Delfilename" type= "checkbox" id= "Delfilename" value= "<%=ffiles.name%>"/>
</div></td></tr>
<%
End If
Next
%>
<tr>
&LT;TD height= "colspan=" 4 "bgcolor=" #FFFFFF "><div align=" center ">
Common Files <font color= "#FF0000" style= "Font-family:georgia, ' Times New Roman ', times, serif ' ><%=filecounts%> </font>, occupy space <font color= "#FF0000" style= "Font-family:georgia, ' Times New Roman ', Times, serif" ><%= FormatNumber ((filesizes/1024), 2)%>k</font><br/>
<input name= "Dxy_foldername" type= "hidden" id= "Dxy_foldername" value= "<%=request" ("Dxy_foldername")%> "/ >
<input type= "button" Name= "Submit2" value= "Select All/select Onclick=" Checkall () "/>"

<input type= "Submit" name= "Submit" value= "OK Delete selected file"/>
</p>
<input name= "Action" type= "hidden" id= "action" value= "Delall"/>
</div></td>
</tr>
</form>
</table>
<table width= "760" height= "border=" 0 "align=" center "cellpadding=" 0 "cellspacing=" 0 ">
<tr>
&LT;TD bgcolor= "#FFFFFF" ><div align= "center" >
<%
If filecounts mod pagesize=0 then
Pagecount=filecounts/pagesize
Else
Pagecount=filecounts/pagesize+1
End If
If Page>pagecount Then
Page=pagecount
Else
Page=page
End If
For Ii=1 to PageCount
If Page=ii Then
Response.Write "<a href=picmanage.asp?" Page= "&ii&" >[<font color=red> "&ii&" </font>]</a> "
Else
Response.Write "<a href=picmanage.asp?" Page= "&ii&" >["&ii&"]</a> "
End If
Next
%>
</div></td>
</tr>
</table>
</body>

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.