problem on downlaod zip file via asp net application

S

Sharon

when i try to download my zip file via my asp net program, the zip file will
be corrupted after i download, below is my code:

' Identify the file to download including its path.
Dim filepath As String = Server.MapPath("\eClinicApp\VISITD.ZIP")

' Identify the file name.
Dim filename As String = System.IO.Path.GetFileName(filepath)

Response.Clear()

' Specify the Type of the downloadable file.
' octet-stream
Response.ContentType = "application/octet-stream"

' Set the Default file name in the FileDownload dialog box.
Response.AddHeader("Content-Disposition", "attachment; filename="""
& filename & """")


' Download the file.
Response.WriteFile(filepath)

Response.Flush()



Any body know what happen, pls help
 
K

Karl

Sharon,
When I treid that code in my Page_Load with nothing else it worked fine :(

Have you tried an different zip file or a non-zipped file?

Karl
 

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

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,186
Members
46,740
Latest member
JudsonFrie

Latest Threads

Top