473,516 Members | 2,956 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Downloading closes my application

When a user is redirected to our app thru a _blank target hyperlink,
everything seems to work fine until he downloads a file from our site. This
is the code used for downloading:

Dim fso As New Scripting.FileSystemObject()
Dim TS As Object
Dim strFile As String
Dim strFileSave As String
Dim b As Byte
Dim MyFileInfo As FileInfo
Dim StartPos, FileSize As Long
Dim sr As StreamReader

strFile = Application("tmpFolder") & Session("ID") &
Session("Socio") & ".qif"
strFileSave = Session("ID") & Session("Socio") & ".qif"

MyFileInfo = New FileInfo(strFile)
FileSize = MyFileInfo.Length
Response.ContentType = "bad/type"
Response.AddHeader("Content-Disposition", "attachment;filename=" &
strFileSave)
HttpContext.Current.Response.AppendHeader("Content-disposition",
"attachment; filename=" & strFileSave)
HttpContext.Current.Response.WriteFile(Application ("tmpFolder") &
strFileSave, StartPos, FileSize)
HttpContext.Current.Response.End()

Once the download Save As dialog window pops up, our app window closes. The
strange thing is the user can still download the file ok, but has to navigate
to our site again, to start all over.

Any ideas or suggestions?

Thanx
Sep 7 '06 #1
0 1014

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

Similar topics

7
10129
by: Xerxes | last post by:
Hi, I have a link in my page that allows users to download an exe file. However, when I download and run it, it briefly displays the DOS box and nothing happens. In my php file, I have: header("Content-Type: application/octet-stream"); header("Content-Disposition: atachment; filename=$filename"); header("Content-Length:...
5
1506
by: mffl | last post by:
We have numerous pages that allow users to download textfiles. To invoke the File Download Dialog, we use ASP, FSO and ADODB Stream. It worked fine in SP1. In SP2, however, once downloading is done, the window that opened the File Download Dialog automatically closes. Any idea what's causing this? Where can I find information on SP2 in...
5
7125
by: Andrew | last post by:
I am running a windows 2000 sv with IIS. My asp script creates a text file with an activation generated and put into the text file, so that the text file can be inported into a software program tha I created. This take away the maunuly typing in the code. Is thier an easy way to use asp to zip of the file and then the user can download the...
5
4902
by: John Morgan | last post by:
I am using the following link to download a file of about 50k <a target= "_blank" href="http://www.bsecs.org.uk/ExecDocs/documentStore/elfridaWord.doc">open file</a> If I save the file to hard disk there is no problem/ if, in response to the menu which appears before downloading, I opt to open the doc file immediately then I get a...
0
851
by: shivam via DotNetMonster.com | last post by:
We have encountered a small problem in our application . We have a screen in our application that downloads a file. Now what is happening is that while we are running the application in a Windows XP machine which has Service Pack 2 , on the click of Download button in the screen, an option appears for saving the file to the disk. As soon as a...
1
2050
by: just.starting | last post by:
Hi, My dot net client downloads files and checks for any new files time to time. The server is apache2.0.53 server. So what happens is that my file download thing works fine if I dont try to call any page from the server while downloading. If I try to call a single page while downloading a file then the page request goes time out and the...
3
2776
by: just.starting | last post by:
Hi, My dot net client downloads files and checks for any new files time to time. The server is apache2.0.53 server. So what happens is that my file download thing works fine if I dont try to call any page from the server while downloading. If I try to call a single page while downloading a file then the page request goes time out and the...
23
1793
by: Doug van Vianen | last post by:
Hi, Is there some way in JavaScript to stop the downloading of pictures from a web page? Thank you. Doug van Vianen
3
1972
by: bfmcfarlane | last post by:
I have an appication that allows users to upload and download files. This application is only accessed when a user clicks on an "Upload / Download" link from within our main application. A new window is launched asking the user which file he /she wants to download. After the user determines which file to download, the window disappears but...
0
7276
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...
0
7408
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7581
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7548
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...
0
5714
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...
0
3267
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...
0
1624
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
825
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
488
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.