Hi,
I have a database table where the user marks files to be downloaded. Subsequently, I browse this table and need to create a fileList to pass to an ActiveX downloader. My routine works locally and on the server for ONLY the first file. I know my logic must be bad, but I cannot find it. All of these files are always in the same server directory which is as follows: "D:\inetpub\vhosts\WebSite.com\sessionVideos\"
Sub (GetFileList)
Dim dtVideosSelected As New DataTable
Dim drVideosSelected As New DataRow
Dim strSourceDirectory As String = "sessionVideos/"
Dim strServerBasePath As String = Server.MapPath(strSourceFileDirectory)
Dim strFileName As String
Dim fileInfo As System.IO.FileInfo
Dim i As Int16
Response.Clear()
Response.ContentType = "text/plain"
Response.Charset = "UTF-8"
i = 0
Do While i < dt VideosSelected.Rows.Count
drVideosSelected = dtVideosSelected.Rows(i)
strFileName = drVideosSelected("VID_FileName")
If File.Exists(strServerbasePath & strFileName)
fileInfo = New System.IO.FileInfo(strServerbasePath & strFileName)
Response.Write("*/* | " & fileInfo.Length & " | " & fileInfo.Name & " | ")
Response.Write(EncodeFileName(strSourceFileDirectory & fileInfo.Name) & vbCr
& vbLf)
End If
i += 1
Loop
Response.End()
Response.Flush()
End Sub
Private Function EncodeFileName(ByVal fullPath As String) As String
Return Server.UrlEncode(fullPath).Replace("+", "%20").Replace("%2f", "/")
End Function
I have tried a lot of differnet things with no success. Thank you for any assistance!
James