473,589 Members | 2,651 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.FileS ystemObject()
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("tm pFolder") & Session("ID") &
Session("Socio" ) & ".qif"
strFileSave = Session("ID") & Session("Socio" ) & ".qif"

MyFileInfo = New FileInfo(strFil e)
FileSize = MyFileInfo.Leng th
Response.Conten tType = "bad/type"
Response.AddHea der("Content-Disposition", "attachment;fil ename=" &
strFileSave)
HttpContext.Cur rent.Response.A ppendHeader("Co ntent-disposition",
"attachment ; filename=" & strFileSave)
HttpContext.Cur rent.Response.W riteFile(Applic ation("tmpFolde r") &
strFileSave, StartPos, FileSize)
HttpContext.Cur rent.Response.E nd()

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 1020

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

Similar topics

7
10141
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: ".filesize("$path/$filename")); header("Pragma: no-cache");
5
1514
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 relation to FSO and ADODB Stream? Thanks.
5
7128
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 file? My other question is, is there a way to create a function in asp that can run when IE...
5
4909
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 problem.
0
854
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 user clicks on Save button, the Application behind it closes. This is not happening when we have...
1
2063
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 server then closes the existing download stream and the client doestn't throw any exception. So many a...
3
2782
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 server then closes the existing download stream and the client doestn't throw any exception. So many a...
23
1811
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
1987
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 the user is provided with the download file dialog box. I have been able to track it down to a...
0
7931
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...
0
7865
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8233
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8360
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7990
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
6637
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...
0
3849
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...
1
1461
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1198
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.