S
Skwish
Hi,
I would like to download all the files from a folder (of various types i.e.
..txt, .dll, .dat, etc.). I tried
Dim MyDir As IO.Directory
Dim path As String = Me.MapPath(".") & "\Data"
Dim dirs As String() = IO.Directory.GetFiles(path)
Dim iLoop As Integer
Dim FileName As String
'Set the appropriate ContentType.
Response.ContentType = "multipart/mixed"
For iLoop = dirs.GetLowerBound(0) To dirs.GetUpperBound(0) - 1
FileName = dirs(iLoop).Substring(dirs(iLoop).LastIndexOf("\") + 1)
Response.AppendHeader("Content-Disposition", "attachment; filename=" &
FileName)
Response.WriteFile(dirs(iLoop))
Next
This gets a single file with the name of the first file with all the files
combined. I have tried the multipart/mixed, but I not sure what to use as a
boundry or how to get the multiple filenames.
Any advice would be appreciated,
Thanks,
Stephen
I would like to download all the files from a folder (of various types i.e.
..txt, .dll, .dat, etc.). I tried
Dim MyDir As IO.Directory
Dim path As String = Me.MapPath(".") & "\Data"
Dim dirs As String() = IO.Directory.GetFiles(path)
Dim iLoop As Integer
Dim FileName As String
'Set the appropriate ContentType.
Response.ContentType = "multipart/mixed"
For iLoop = dirs.GetLowerBound(0) To dirs.GetUpperBound(0) - 1
FileName = dirs(iLoop).Substring(dirs(iLoop).LastIndexOf("\") + 1)
Response.AppendHeader("Content-Disposition", "attachment; filename=" &
FileName)
Response.WriteFile(dirs(iLoop))
Next
This gets a single file with the name of the first file with all the files
combined. I have tried the multipart/mixed, but I not sure what to use as a
boundry or how to get the multiple filenames.
Any advice would be appreciated,
Thanks,
Stephen