<% Response.Buffer=True Dim oFSO Dim oFileItem Dim oFolder Dim oSubFolder Dim CurrentPath Dim CurrentFile Set oFSO = CreateObject("Scripting.FileSystemObject") CurrentPath = Request("Path") If CurrentPath = "" Then CurrentPath = Server.Mappath(".") Set oFolder = oFSO.GetFolder(CurrentPath) Set oFolderContents = oFolder.Files %>
Media Server
  Current Path:       <%= CurrentPath%>
<% For Each oSubFolder in oFolder.SubFolders %> <% Next filetmp = "mms://mediaserver.uprm.edu/" patharray = split(CurrentPath,"\",-1,1) For Each pathItem in patharray If pathItem <> "/" Then If pathItem <> "videos" Then fileoutput = filetmp & pathItem & "/" filetmp = fileoutput End If End If Next For Each oFileItem in oFolder.Files If oFileItem.Name <> "default.asp" Then If oFileItem.Name <> "Thumbs.db" Then %> <% End If End If Next ' ********************************* DOWNLOAD FILE CODE ************************************* Dim strPath strPath=CSTR(Request("File")) '-- do some basic error checking for the QueryString If strPath <> "" Then Call DownloadFile(strPath) End If Private Sub DownloadFile(file) '--declare variables Dim strFileExtension Dim objFSO Dim objFile Dim objStream '-- create FSO object to check if file exists and get properties Set objFSO = Server.CreateObject("Scripting.FileSystemObject") '-- check to see if the file exists response.write file If objFSO.FileExists(file) Then Set objFile = objFSO.GetFile(file) '-- first clear the response, and then set the appropriate headers Response.Clear '-- the filename you give it will be the one that is shown ' to the users by default when they save Response.AddHeader "Content-Disposition", "attachment; filename=" & objFile.Name Response.AddHeader "Content-Length", objFile.Size Response.ContentType = "application/octet-stream" Set objStream = Server.CreateObject("ADODB.Stream") objStream.Open '-- set as binary objStream.Type = 1 Response.CharSet = "UTF-8" '-- load into the stream the file objStream.LoadFromFile(file) '-- send the stream in the response Response.BinaryWrite(objStream.Read) objStream.Close Set objStream = Nothing Set objFile = Nothing Else 'objFSO.FileExists(file) Response.Clear Response.Write("No such file exists.") End If Set objFSO = Nothing End Sub ' ****************************************************************************************** %>
File Name File Size Created on File Type  
><%= oSubFolder.Name %>
   <%= FormatDateTime(oSubFolder.DateCreated,2) %> Folder
><%=oFileItem.Name%>
 <%= oFileItem.Size %>  <%= FormatDateTime(oFileItem.DateCreated,2) %> <%= oFileItem.Type%>