473,402 Members | 2,050 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

problem on downlaod zip file via asp net application

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


Nov 18 '05 #1
1 1166
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

"Sharon" <sh*****@hotmail.com> wrote in message
news:u2**************@TK2MSFTNGP10.phx.gbl...
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

Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Al Murphy | last post by:
Hi, I hope that you can help me wit this one please and apologies if i'm in the wrong forum! I recently bought a book that contaiend a CD-ROM of very useful Visual Basic algoritms. Now these...
0
by: jeff | last post by:
Hiya im trying to pull tags off a website using python ive got a few things running that have the potential to work its just i cant get them to becuase of certain errors? basically i dont...
1
by: delu | last post by:
Can anybody teach me how to write a code using asp, so that i can downlaod file from server to a fixed folder on local computer? Best regards
0
by: Liensun | last post by:
The application is coded using ASP.net and C#. A part of the application allows the user to download files. The size of these files can be up to 80 MB. It works when the connection bandwidth is...
12
by: SJD | last post by:
I've just read Christoph Schittko's article on XmlSerializer: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnxmlnet/html/trblshtxsd.asp . . . and very informative it is too....
2
by: Sharon | last post by:
Can anybody teach me how to write a code using asp net, so that i can downlaod file from server to local computer? Best regards
1
by: svijay | last post by:
hi I have got a strange problem. May I know any solution for this. Here is the detailed description about the problem We have got a mainframe system and also production and development...
3
by: chudson007 | last post by:
Can somebody help me with a delimiter problem I have. I have several PIPE (|) delimted text files which I need to import to SQL. With one of the files I keep encountering the following error;...
6
by: Tony Johansson | last post by:
Hello! We have a C#.ASP.NET application that runs on a IIS 6. The application contains actually several asp pages but there is no GUI. The application receive an xml file that is processed....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.