%
Dim iTr, objFSO, objFiles, objFolders, strPath, maxColumns, subFolder, containedFile, strPhysicalPath
Dim i, maxUpload:maxUpload = 10
Dim deletefile
Dim delfile:delfile = request.querystring("delfile")&""
Dim delType:delType = request.querystring("deltype")&""
Dim subFoldersCount, subFilesCount
Dim iFileCount
Dim avatarPath
Dim defaultFolderObj
Dim totalSizeInFolder:totalSizeInFolder = 0
'response.write delfile
'response.end
if len(delfile)<>0 then
set objFSO = Server.CreateObject("Scripting.FileSystemObject")
with objFSO
deletefile = server.mappath(delfile)
if delType = "f" then
if .folderexists(deletefile) then .DeleteFolder deletefile, true
else
if .fileexists(deletefile) then .DeleteFile deletefile, true
end if
end with
set objFSO = nothing
avatarPath = delfile
end if
Dim createFolder:createFolder = request.querystring("createFolder")&""
Dim folderSpec
if len(createFolder)<>0 then
set objFSO = Server.CreateObject("Scripting.FileSystemObject")
with objFSO
folderSpec = server.mappath(createFolder)
if not .folderexists(folderSpec) then .CreateFolder folderSpec
end with
set objFSO = nothing
avatarPath = createFolder 'to read the content
end if
%>
Smiley/Avatar Upload and Management
<%= OutputCSS() %>
Smiley/Avatar Upload and Management:
<%
strPhysicalPath = server.mappath("upfiles/smiley/")
set objFSO = Server.CreateObject("Scripting.FileSystemObject")
set defaultFolderObj = objFSO.GetFolder(strPhysicalPath)
set objFiles = defaultFolderObj.files
totalSizeInFolder = defaultFolderObj.size
subFilesCount = objFiles.count
set defaultFolderObj = nothing
set objFSO = nothing
maxColumns = 5
iTr = 1
%>
<%
strPath = request.queryString("d")
if instr(avatarPath,"avatars/") then strPath = processAvatars(avatarPath)
strPath = replace(replace(strPath,"{",""),"}","")
strPhysicalPath = server.mappath("avatars/"&strPath)
set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set defaultFolderObj = objFSO.GetFolder(strPhysicalPath)
set objFolders = defaultFolderObj.subFolders
set objFiles = defaultFolderObj.files
subFilesCount = objFiles.count
subFoldersCount = objFolders.count
totalSizeInFolder = defaultFolderObj.size
set defaultFolderObj = nothing
set objFSO = nothing
if strPath <>"" then strPath = strPath &"/"
maxColumns = 3
iTr = 1
%>
<% if strPath <> "" then %>
<%
Dim upStrPath, leftAmount
upStrPath = strPath
upStrPath = left(upStrPath,len(upStrPath)-1)
leftAmount = instrRev(upStrPath,"/")
if leftAmount <> 0 then
leftAmount = leftAmount - 1
else
leftAmount = 0
end if
Dim doUpFolder:doUpFolder = 1
%>
<% end if %>