%
response.Expires=0
sBaseFolder = "../images/" 'Locate your assets folder here (Relative to Root)
'Absolute path => see line 299
dim sOptions
set oFSO = server.CreateObject ("Scripting.FileSystemObject")
set oFolder_base = oFSO.GetFolder(server.MapPath(sBaseFolder)) 'base folder (Physical)
if(Len(CStr(request("inpCurrFolder")))=0) then
currFolder = server.MapPath(sBaseFolder) 'opened folder (Physical)
else
currFolder = request("inpCurrFolder") 'opened folder (Physical)
end if
if(Len(CStr(request("inpFileToDelete")))<>0) then 'Delete File
Set oFile = oFSO.GetFile(Server.MapPath(CStr(request("inpFileToDelete"))))
oFile.Delete
end if
function writeFolderSelections()
response.write "Folders "
response.Write ""
end function
function recursive(oFolder)
set oSubFolders = oFolder.SubFolders
if not(oFolder.attributes and 2) then 'not hidden folder
sDisplayed = Replace(Replace(oFolder.path,oFolder_base.path,""),"\","/")'display hanya bagian di dalam base folder, ex: "", "/gallery01", "/gallery02"
if CStr(currFolder)=CStr(oFolder.path) then
sOptions = sOptions & "" & vbCrLf
else
sOptions = sOptions & "" & vbCrLf
end if
end if
for each item in oSubFolders
recursive item
next
sOptions = sOptions & vbCrLf
recursive = sOptions
end function
function writeFileSelections()
set oFolder = oFSO.GetFolder(currFolder)
set oFiles = oFolder.files
nIndex=0
sHTML = sHTML & "
"
sHTML = sHTML & "
"
sHTML = sHTML & "
Files
"
sColor = "#e7e7e7"
for each oFile in oFiles
nIndex=nIndex+1
sBaseFolder_PhysicalPath = oFolder_base.path 'folder terakhir tdk diikuti dgn / shg sFile_VirtualPath_UnderBaseFolder diawali dgn /
sFile_PhysicalPath = oFile.path
sFile_VirtualPath_UnderBaseFolder = replace(replace(sFile_PhysicalPath,sBaseFolder_PhysicalPath,""),"\","/") 'physical to virtual, ex: "", "/gallery01", "/gallery02"
if mid(sFile_VirtualPath_UnderBaseFolder,1,1)="/" then
sFile_VirtualPath_UnderBaseFolder=mid(sFile_VirtualPath_UnderBaseFolder,2)
end if
'response.write(sFile_VirtualPath_UnderBaseFolder &" ")
sFile_VirtualPath = CStr(sBaseFolder & sFile_VirtualPath_UnderBaseFolder)
'response.write(sFile_VirtualPath &" ")
if sColor = "#e7e7e7" then
sColor = ""
else
sColor = "#e7e7e7"
end if
sHTML = sHTML & "