Hello
Thanks in advance.
This code loops through a directory and places the value in a response.write link.
I am using Frames to display the data. I have a left frame and a content (right) frame. Right now it shows the file content in the left frame once I click it. What I would like to do is this
Once i click the link the file (XML) would be displayed in the Content ( right )frame
Does anyone know how to do this
<%
dim fs,fo,x
ListFolderContents(Server.MapPath("/My/Path")) %>
<% sub ListFolderContents(path)
dim fs, folder, file, item, url, it
set fs = CreateObject("Scripting.FileSystemObject")
set folder = fs.GetFolder(path)
for each item in folder.Files
url = MapURL(item.path)
Response.Write("<li><a href=""" & url & """>" & item.Name & "</a> - " _
& "last modified on " & item.DateLastModified & "." _
& "</li>" & vbCrLf)
next
response.write url
Response.Write("</ul>" & vbCrLf)
Response.Write("</li>" & vbCrLf)
end sub
function MapURL(path)
dim rootPath, url
' Convert a physical file path to a URL for hypertext links.
rootPath = Server.MapPath("/")
url = Right(path, Len(path) - Len(rootPath))
MapURL = Replace(url, "\", "/")
end function %>
</p>
Thanks in advance.
This code loops through a directory and places the value in a response.write link.
I am using Frames to display the data. I have a left frame and a content (right) frame. Right now it shows the file content in the left frame once I click it. What I would like to do is this
Once i click the link the file (XML) would be displayed in the Content ( right )frame
Does anyone know how to do this
<%
dim fs,fo,x
ListFolderContents(Server.MapPath("/My/Path")) %>
<% sub ListFolderContents(path)
dim fs, folder, file, item, url, it
set fs = CreateObject("Scripting.FileSystemObject")
set folder = fs.GetFolder(path)
for each item in folder.Files
url = MapURL(item.path)
Response.Write("<li><a href=""" & url & """>" & item.Name & "</a> - " _
& "last modified on " & item.DateLastModified & "." _
& "</li>" & vbCrLf)
next
response.write url
Response.Write("</ul>" & vbCrLf)
Response.Write("</li>" & vbCrLf)
end sub
function MapURL(path)
dim rootPath, url
' Convert a physical file path to a URL for hypertext links.
rootPath = Server.MapPath("/")
url = Right(path, Len(path) - Len(rootPath))
MapURL = Replace(url, "\", "/")
end function %>
</p>