Dim Fso,fsofile,filetype,filesize,filetime,path
Dim Dir
Action=trim (Request ("Action"))
Set fso=server.createobject ("Scripting.FileSystemObject")
Iserr
If Action = "Del" Then
Call Delall
Else
Dir=trim (Request.QueryString ("Dir"))
Path = Server.MapPath (uploadfolder) & Dir
Set fsofile = Fso.getfolder (Server.MapPath (Uploadfolder))
Fsofilesize = Fsofile.size ' Space size statistics
Set fsofile = Nothing
Set fsofile = Fso.getfolder (Path)
Response.Write ("<table class= ' table ' cellspacing= ' 1 ' cellpadding= ' 3 ' width= ' 98% ' align= ' center ' border= ' 0 ' >") &vbcrlf
Response.Write ("<tr>") &vbcrlf
Response.Write ("<td width= ' 80% ' class= ' Hback ' > main catalogue: ...") &UploadFileDir& " space Occupancy:")
Response.Write GetFileSize (Fsofilesize)
Response.Write (" <br/> Current directory: <a href= ' admin_upfiles.asp ' title= ' return home directory" ><font Color= ' #FF0000 '. </font></a><font color= ' #0000FF ' > ' &Dir& ' </font> occupancy Space: ')
Response.Write GetFileSize (Fsofile.size)
Response.Write (" includes <font color= ' #FF0000 ' >" &FsoFile.SubFolders.count& "</ font> folders; <font color= ' red ' ><b> ' &FsoFile.Files.count& ' </b>< /FONT> Files </td> ") &vbcrlf
Response.Write ("</tr>") &vbcrlf
Response.Write ("</table>") &vbcrlf
Response.Write ("<form name= ' form ' method= ' post ' action= '?") Action=del ' style= ' margin:0 ' > ') &vbcrlf
Response.Write ("<table class= ' table ' cellspacing= ' 1 ' cellpadding= ' 3 ' width= ' 98% ' align= ' center ' border= ' 0 ' >") &vbcrlf
Response.Write ("<tr class= ' Xingmu ' height= ' >") &vbcrlf
Response.Write ("<th width= ' 10% ' height= ' align= ' center ' class= ' Xingmu ' > Check </th>") &vbcrlf
Response.Write ("<th width= ' 30% ' align= ' center ' class= ' XINGMU ' > File/folder name </th>") &vbcrlf
Response.Write ("<th width= ' 10% ' align= ' center ' class= ' Xingmu ' > Type </th>") &vbcrlf
Response.Write ("<th width= ' 15% ' align= ' center ' class= ' xingmu ' > File size </th>") &vbcrlf
Response.Write ("<th align= ' center ' class= ' Xingmu ' > Last modified Time </th>") &vbcrlf
Response.Write ("</tr>") &vbcrlf
For each dirfolder in Fsofile.subfolders
Foldername=dirfolder.name
Foldersize=getfilesize (Dirfolder.size)
Foldertime=dirfolder.datelastmodified
Response.Write ("<tr onmouseover= ' Overcolor (this) ' onmouseout= ' Outcolor (this) ' >") &vbcrlf
Response.Write ("<td align= ' center ' class= ' hback ' > <input type= ' checkbox ' name= ' FolderID ' value= '" "& foldername& "' onclick=" "Checkitem (This, ' Chkall ')" "></td>") &vbcrlf
Response.Write ("<td align= ' left ' class= ' hback ' > <a href=?action=open&dir= '" &Dir& ") &FolderName& ">" &FolderName& "</a></td>") &vbcrlf
Response.Write ("<td align= ' center ' class= ' hback ' ></td> ') &vbcrlf
Response.Write ("<td align= ' center ' class= ' hback ' >" &FolderSize& "</td>") &vbcrlf
Response.Write ("<td align= ' left ' class= ' Hback ' >" &FolderTime& "</td>") &vbcrlf
Response.Write ("</tr>") &vbcrlf
Next
For each dirfiles in Fsofile.files
Filename=dirfiles.name
Filetype=getfileicon (FileName)
Filesize=getfilesize (Dirfiles.size)
Filetime=dirfiles.datelastmodified
Response.Write ("<tr onmouseover= ' Overcolor (this) ' onmouseout= ' Outcolor (this) ' >") &vbcrlf
Response.Write ("<td align= ' center ' class= ' hback ' > <input type= ' checkbox ' name= ' Fileid ' value= '" "& filename& "' onclick=" "Checkitem (This, ' Chkall ')" "></td>") &vbcrlf
Response.Write ("<td align= ' left ' class= ' hback ' > <a href= '" &UploadFolder&Dir& "/" &FileName& "' target= ' _blank ' >" &FileName& "</a></td>") &vbcrlf
Response.Write ("<td class= ' hback ' align= ' center ' ></td> ') &vbcrlf
Response.Write ("<td align= ' center ' class= ' hback ' >" &FileSize& "</td>") &vbcrlf
Response.Write ("<td align= ' left ' class= ' Hback ' >" &FileTime& "</td>") &vbcrlf
Response.Write ("</tr>") &vbcrlf
Next
Response.Write ("</table>") &vbcrlf
Response.Write ("<table width= ' 98% ' border= ' 0 ' cellspacing= ' 0 ' cellpadding= ' 0 ' align= ' center ' >") &vbcrlf
Response.Write ("<tr>") &vbcrlf
Response.Write ("<td width= ' 10% ' align= ' center ' ><input type= ' checkbox ' name= ' checkall ' value= ' checkbox ') Onclick= "" Checkall (This, ' Fileid ') "" ></td> ") &vbcrlf
Response.Write ("<td colspan= ' 4" height= ' > <input name= ' Del ' type= ' Submit ' class= ' Button ' id= ') Del ' style= ' cursor:hand ' value= ' delete ' onclick= ' {if (Confirm (' OK to delete selected file or folder!? ') {this.document.form.submit (); return true;} return false;} "" > <input type= ' hidden ' name= ' thisdir ' value= ' "&Dir&" ' > <input name= ' AA ' type= ' button ' class= ' button ' id= ' AA ' value= ' returns to the picture catalog ' onclick= ' "javascript:window.location.href=" Admin_upfiles.asp '; ' " ></td> ") &vbcrlf
Response.Write ("</tr>") &vbcrlf
Response.Write ("</table>") &vbcrlf
Response.Write ("</form>") &vbcrlf
End If
Set fsofile = Nothing
Set Fso = Nothing