Download File

S

Skwish

Hi,

I have been using

Dim filename As String
Dim filepath As String

filename = "Steve.txt"
filepath = Server.MapPath(".") & "\" & filename
Response.Clear()
Response.ContentType = "application/octet-stream"
Response.AddHeader("Content-Disposition", "attachment; filename=" &
filename )
Response.WriteFile(filepath)
Response.End()

To download a single file from server to client. However, I would like to
move an entire folder of files and I have been unsuccessful. If I use the
above inside a loop for each file in the folder, I end up with a single file
on the client (all the files put into one with the first file's name).

Can someone help please? Also, what is the Response.AddFileDependencies
method do? There is no good documentation and it would seem that it might
be useful in my problem.

Thanks,

Stephen
 
J

Jerron

you need to use mutipart MIME to separate each files, like following:

Content-Type: multipart/mixed;
boundary="----_=_NextPart_001_01C3BE96.0ABC9C61"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top