<% ' /////////////////////////////////////////////////////// ' // Dimac CMS ' // Copyright 2004-2008 Dimac Development AB, Sweden ' // www.Dimac.net ' // ' // NOTE: ' // You are not allowed to remove this ' // Copyright information without written ' // permission from Dimac Development. ' /////////////////////////////////////////////////////// If NOT CBool(Session("ValidAdminUser")) Then Response.Redirect("../LIO/loggin.asp") End IF Dim vMediaArchivePreviewRoot, vMediaArchiveStartRoot vMediaArchiveStartRoot = "SiteResources/data/MediaArchive/" vSubFolder = Request.ServerVariables("SCRIPT_NAME") vSubFolder = Mid(vSubFolder,1, InStr(LCase(vSubFolder),"/cmsadmin/site/default_asset2.asp")) assetFolder = "../../SiteResources/data/MediaArchive/files" ' // assetFolder2 = ImagePreviewRoot + MediaArchiveStartRoot + "files/" assetFolder2 = vSubFolder + vMediaArchiveStartRoot + "files" If request.QueryString("xField") <> "" then Session("imageField") = request.QueryString("xField") End IF dim objFSO dim objMainFolder dim strOptions dim strHTML dim catid strHTML = "" set objFSO = server.CreateObject ("Scripting.FileSystemObject") set objMainFolder = objFSO.GetFolder(server.MapPath(assetFolder)) catid = CStr(request("catid")) if catid="" then catid = objMainFolder.path dim objTempFSO dim objTempFolder dim objTempFiles dim objTempFile set objTempFSO = server.CreateObject ("Scripting.FileSystemObject") set objTempFolder = objTempFSO.GetFolder (catid) set objTempFiles = objTempFolder.files strHTML = strHTML & "" for each objTempFile in objTempFiles '*********** 'objTempFile.path => image physical path 'basePath => base path set basePath = objFSO.GetFolder(server.MapPath(assetFolder)) PhysicalPathWithoutBase = Replace(objTempFile.path,basePath.path,"") sTmp = replace(PhysicalPathWithoutBase,"\","/")'fix from physical to virtual 'sCurrImgPath = assetFolder & sTmp sCurrImgPath = assetFolder2 & sTmp '*********** strHTML = strHTML & "" strHTML = strHTML & "" strHTML = strHTML & "" strHTML = strHTML & "" next strHTML = strHTML & "
" & objTempFile.name & "" & FormatNumber(objTempFile.size/1000,0) & " kb" & langLabelSelect & "
" Function createCategoryOptions(pi_objFolder) dim objFolder dim objFolders set objFolders = pi_objfolder.SubFolders for each objFolder in objFolders 'Recursive programming starts here createCategoryOptions objFolder next if pi_objFolder.attributes and 2 then 'hidden folder then do nothing else '*********** set basePath = objFSO.GetFolder(server.MapPath(assetFolder)) 'response.Write catid & " - " & oo.path Response.Write Replace(pi_objFolder.path,basePath.path,"") '*********** if CStr(catid)=CStr(pi_objFolder.path) then strOptions = strOptions & "" & vbCrLf else strOptions = strOptions & "" & vbCrLf end if end if strOptions = strOptions & vbCrLf createCategoryOptions = strOptions End Function %>

My Files

id=form2 name=form2>
<%=langLabelSelectFolder%> : 
<%=langLabelFileName%>
<%=strHTML%>

<%=langLabelSource%>