473,666 Members | 2,157 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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\VI SITD.ZIP")

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

Response.Clear( )

' Specify the Type of the downloadable file.
' octet-stream
Response.Conten tType = "applicatio n/octet-stream"

' Set the Default file name in the FileDownload dialog box.
Response.AddHea der("Content-Disposition", "attachment ; filename="""
& filename & """")
' Download the file.
Response.WriteF ile(filepath)

Response.Flush( )

Any body know what happen, pls help


Nov 18 '05 #1
1 1173
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*****@hotmai l.com> wrote in message
news:u2******** ******@TK2MSFTN GP10.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\VI SITD.ZIP")

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

Response.Clear( )

' Specify the Type of the downloadable file.
' octet-stream
Response.Conten tType = "applicatio n/octet-stream"

' Set the Default file name in the FileDownload dialog box.
Response.AddHea der("Content-Disposition", "attachment ; filename=""" & filename & """")
' Download the file.
Response.WriteF ile(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
2160
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 algoritms are written in visual basic 4 I'm having difficulty importing the projects into Visual Studio .NET. I get an error message stating: "The Visual Basic 6.0 project file is corrupted or cannot be read". Can anyone tell me what I should do to...
0
1761
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 what to download the images and all the stuff just the html and then work from there, i think its timing out because its trying to downlaod the images as well which i dont what to do as this would decrease the speed of what im trying to achieve, the...
1
1395
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
286
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 high. But in other cases, after a few minutes, the next message is displayed: "The connection with server was reset". Here the code that I use: private void SendPageToBrowser(string filename)
12
8484
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. I, too, am getting nasty FileNotFound exceptions. I've read, and digested the article, and I think I've found a bug -- it's difficult to track, though it does happen often.
2
954
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
2399
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 server.
3
6501
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; "Error at Source for Row 27753. Errors encountered so far in this task: 1. Column Delimter not found." I suspect the problem is that one record (and possibly more) has a PIPE
6
2256
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. There is also an MFC dll that is called from this asp application to make a syntax check on quite many commands. You don't have to know what a command is. The problem that we get is the following when the asp pages calls the MFC
0
8454
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
8560
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8644
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7389
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6200
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5671
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4200
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4372
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2012
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.