<% response.Expires=0 %> <% '*** Permission *** bReadOnly0=false bReadOnly1=false bReadOnly2=false bReadOnly3=false '*** /Permission *** set oFSO = server.CreateObject ("Scripting.FileSystemObject") set oFolder_base0 = oFSO.GetFolder(server.MapPath(arrBaseFolder(0))) 'base folder (Physical) if arrBaseFolder(1)<>"" then set oFolder_base1 = oFSO.GetFolder(server.MapPath(arrBaseFolder(1))) 'base folder (Physical) if arrBaseFolder(2)<>"" then set oFolder_base2 = oFSO.GetFolder(server.MapPath(arrBaseFolder(2))) 'base folder (Physical) if arrBaseFolder(3)<>"" then set oFolder_base3 = oFSO.GetFolder(server.MapPath(arrBaseFolder(3))) 'base folder (Physical) dim sOptions %> <% '*** Permission *** bWriteFolderAdmin=false if Not IsEmpty(oFolder_base0) then if InStr(LCase(CStr(currFolder)),LCase(CStr(oFolder_base0.path)))<>0 AND bReadOnly0=true then bWriteFolderAdmin=true end if if Not IsEmpty(oFolder_base1) then if InStr(LCase(CStr(currFolder)),LCase(CStr(oFolder_base1.path)))<>0 AND bReadOnly1=true then bWriteFolderAdmin=true end if if Not IsEmpty(oFolder_base2) then if InStr(LCase(CStr(currFolder)),LCase(CStr(oFolder_base2.path)))<>0 AND bReadOnly2=true then bWriteFolderAdmin=true end if if Not IsEmpty(oFolder_base3) then if InStr(LCase(CStr(currFolder)),LCase(CStr(oFolder_base3.path)))<>0 AND bReadOnly3=true then bWriteFolderAdmin=true end if sFolderAdmin="" if bWriteFolderAdmin then sFolderAdmin="style='display:none'" '*** /Permission *** function writeFolderSelections() response.Write "" end function function recursive(oFolder,oFolder_base,sName) set oSubFolders = oFolder.SubFolders if InStr(1,oFolder.path,"_vti_cnf")=0 then sDisplayed = sName & 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,oFolder_base,sName next sOptions = sOptions & vbCrLf recursive = sOptions end function function getExt(sFile)'ffilter dim sExt sExt="" for each Item In split(sFile,".") sExt = Item next getExt=sExt end function function writeFileSelections() set oFolder = oFSO.GetFolder(currFolder) set oFiles = oFolder.files nIndex=0 bFileFound=false Response.Write "
" & VbCrLf Response.Write "" & VbCrLf 'Response.Write "" sColor = "#e7e7e7" for each oFile in oFiles 'ffilter ~~~~~~~~~~ bDisplay=false sExt=getExt(oFile.path) if ffilter="flash" then if LCase(sExt)="swf" then bDisplay=true elseif ffilter="media" then if LCase(sExt)="avi" or LCase(sExt)="wmv" or LCase(sExt)="mpg" or _ LCase(sExt)="mpeg" or LCase(sExt)="wav" or LCase(sExt)="wma" or _ LCase(sExt)="mid" or LCase(sExt)="mp3" then bDisplay=true elseif ffilter="image" then if LCase(sExt)="gif" or LCase(sExt)="jpg" or LCase(sExt)="png" then bDisplay=true else 'all bDisplay=true end if '~~~~~~~~~~~~~~~~~~ if bDisplay then bFileFound=true nIndex=nIndex+1 'server.MapPath(sBaseFolder) 'oFSO.GetFolder(server.MapPath(sBaseFolder)) ' => sama. yg satu c:\.. yg lain C:\.. 'response.Write oFile.path & " - " & oFSO.GetFolder(server.MapPath(sBaseFolder)) & "
" if InStr(1,oFile.path,oFSO.GetFolder(server.MapPath(arrBaseFolder(0)))) <> 0 then sBaseFolder_PhysicalPath = oFolder_base0.path 'folder terakhir tdk diikuti dgn / shg sFile_VirtualPath_UnderBaseFolder diawali dgn / sBaseFolder = arrBaseFolder(0) end if if arrBaseFolder(1)<>"" then'NEW 2.4 if InStr(1,oFile.path,oFSO.GetFolder(server.MapPath(arrBaseFolder(1)))) <> 0 then sBaseFolder_PhysicalPath = oFolder_base1.path 'folder terakhir tdk diikuti dgn / shg sFile_VirtualPath_UnderBaseFolder diawali dgn / sBaseFolder = arrBaseFolder(1) end if end if if arrBaseFolder(2)<>"" then'NEW 2.4 if InStr(1,oFile.path,oFSO.GetFolder(server.MapPath(arrBaseFolder(2)))) <> 0 then sBaseFolder_PhysicalPath = oFolder_base2.path 'folder terakhir tdk diikuti dgn / shg sFile_VirtualPath_UnderBaseFolder diawali dgn / sBaseFolder = arrBaseFolder(2) end if end if if arrBaseFolder(3)<>"" then'NEW 2.4 if InStr(1,oFile.path,oFSO.GetFolder(server.MapPath(arrBaseFolder(3)))) <> 0 then sBaseFolder_PhysicalPath = oFolder_base3.path 'folder terakhir tdk diikuti dgn / shg sFile_VirtualPath_UnderBaseFolder diawali dgn / sBaseFolder = arrBaseFolder(3) end if end if sFile_PhysicalPath = oFile.path response.write "" & VbCrLf response.write "" & VbCrLf response.write "" & VbCrLf sBaseFolder_PhysicalPath=LCase(sBaseFolder_PhysicalPath)'NEW 2.4 sFile_PhysicalPath=LCase(sFile_PhysicalPath)'NEW 2.4 sFile_VirtualPath_UnderBaseFolder = replace(replace(sFile_PhysicalPath,sBaseFolder_PhysicalPath,""),"\","/") 'physical to virtual, ex: "", "/gallery01", "/gallery02" response.write "" & VbCrLf if mid(sFile_VirtualPath_UnderBaseFolder,1,1)="/" then sFile_VirtualPath_UnderBaseFolder=mid(sFile_VirtualPath_UnderBaseFolder,2) end if response.write "" & VbCrLf sFile_VirtualPath = CStr(sBaseFolder & sFile_VirtualPath_UnderBaseFolder) response.write "" & VbCrLf response.write "" & VbCrLf if sColor = "#EFEFF5" then sColor = "" else sColor = "#EFEFF5" end if 'icons sIcon="ico_unknown.gif" If LCase(sExt)="asp" then sIcon="ico_asp.gif" If LCase(sExt)="bmp" then sIcon="ico_bmp.gif" If LCase(sExt)="css" then sIcon="ico_css.gif" If LCase(sExt)="doc" then sIcon="ico_doc.gif" If LCase(sExt)="exe" then sIcon="ico_exe.gif" If LCase(sExt)="gif" then sIcon="ico_gif.gif" If LCase(sExt)="htm" then sIcon="ico_htm.gif" If LCase(sExt)="html" then sIcon="ico_htm.gif" If LCase(sExt)="jpg" then sIcon="ico_jpg.gif" If LCase(sExt)="js" then sIcon="ico_js.gif" If LCase(sExt)="mdb" then sIcon="ico_mdb.gif" If LCase(sExt)="mov" then sIcon="ico_mov.gif" If LCase(sExt)="mp3" then sIcon="ico_mp3.gif" If LCase(sExt)="pdf" then sIcon="ico_pdf.gif" If LCase(sExt)="png" then sIcon="ico_png.gif" If LCase(sExt)="ppt" then sIcon="ico_ppt.gif" If LCase(sExt)="mid" then sIcon="ico_sound.gif" If LCase(sExt)="wav" then sIcon="ico_sound.gif" If LCase(sExt)="wma" then sIcon="ico_sound.gif" If LCase(sExt)="swf" then sIcon="ico_swf.gif" If LCase(sExt)="txt" then sIcon="ico_txt.gif" If LCase(sExt)="vbs" then sIcon="ico_vbs.gif" If LCase(sExt)="avi" then sIcon="ico_video.gif" If LCase(sExt)="wmv" then sIcon="ico_video.gif" If LCase(sExt)="mpeg" then sIcon="ico_video.gif" If LCase(sExt)="mpg" then sIcon="ico_video.gif" If LCase(sExt)="xls" then sIcon="ico_xls.gif" If LCase(sExt)="zip" then sIcon="ico_zip.gif" if(LCase(oFile.name)=LCase(sUploadedFile))then sColorResult="yellow" iSelected=nIndex else sColorResult=sColor end if Response.Write "" & VbCrLf & _ "" & VbCrLf & _ "" & VbCrLf & _ "" & VbCrLf & _ "" & VbCrLf & _ "" & VbCrLf end if next if bFileFound=false then Response.Write "
"&getTxt("Files")&"
" & oFile.name & "  " & FormatNumber(oFile.size/1000,1) & " kb " & VbCrLf if not bWriteFolderAdmin then Response.Write "" & VbCrLf end if Response.Write "
" else Response.Write "" end if Response.Write "" Response.Write "" end function %> <% sLang="english" if Len(Cstr(Request.QueryString("lang")))<>0 then sLang=Request.QueryString("lang") end if %> "> "> ">
<%writeFolderSelections()%>  >New Folder  >Del Folder <% 'ffilter~~~~~~~~~ sHTMLFilter = "" Response.Write sHTMLFilter '~~~~~~~~~ %>
<%writeFileSelections()%>
>
<%=sMsg%>
Upload File: