473,804 Members | 3,771 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Way to close the UA after forced file download?

I am pushing a file download to the client. The ASP used to generate and
push the file is triggered by an <a target="_blank" href="something ">. The
VBScript uses

Response.Clear
Response.Conten tType = [some mime type]
Response.AddHea der "Content-Disposition", "attachment ; filename=myfile .txt"
Response.Write [stuff]
Response.Flush
Response.End

All is working fine. The user is prompted for the disposition of the
download, the file is transferred. Life is wonderful ... except for one
minor annoyance ...

The user is left with a blank page (containing minimal skeletal HTML) in
front of them after the download.

Is there a way to eliminate the blank page without having to redirect back
to the calling page?
Jul 22 '05 #1
22 1878
Gazing into my crystal ball I observed "MyndPhlyp" <no****@homerig ht.now>
writing in news:Ob******** ******@tk2msftn gp13.phx.gbl:
I am pushing a file download to the client. The ASP used to generate
and push the file is triggered by an <a target="_blank"
href="something ">. The VBScript uses

Response.Clear
Response.Conten tType = [some mime type]
Response.AddHea der "Content-Disposition", "attachment ;
filename=myfile .txt" Response.Write [stuff]
Response.Flush
Response.End

All is working fine. The user is prompted for the disposition of the
download, the file is transferred. Life is wonderful ... except for one
minor annoyance ...

The user is left with a blank page (containing minimal skeletal HTML)
in front of them after the download.

Is there a way to eliminate the blank page without having to redirect
back to the calling page?


Yes, stop using the target attribute. The target attribute is deprecated
except for the Frameset element.

--
Adrienne Boswell
http://www.cavalcade-of-coding.info
Please respond to the group so others can share
Jul 22 '05 #2

"Adrienne" <ar********@sbc global.net> wrote in message
news:Xn******** *************** *****@207.115.6 3.158...

Yes, stop using the target attribute. The target attribute is deprecated
except for the Frameset element.


I have found nothing indicating that the target attribute in anchors is
depreciated. The HTML 4.01 specifications do not show it depreciated plus
the W3 HTML Validator for DOCTYPES XHTML 1.0 Transitional and HTML 4.01
Transitional does not flag it as depreciated.

Cite your source.

(But yes, removing the target attribute does cure the symptom. Thanx.)
Jul 22 '05 #3
MyndPhlyp wrote:
"Adrienne" <ar********@sbc global.net> wrote in message
news:Xn******** *************** *****@207.115.6 3.158...

Yes, stop using the target attribute. The target attribute is
deprecated except for the Frameset element.


I have found nothing indicating that the target attribute in anchors
is depreciated. The HTML 4.01 specifications do not show it
depreciated plus the W3 HTML Validator for DOCTYPES XHTML 1.0
Transitional and HTML 4.01 Transitional does not flag it as
depreciated.

Cite your source.


Ummm, just do a google for deprecated target attribute.

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 22 '05 #4
You're right. It's not depreciated. Attributes retain their value throught
their lifetime.

It is, however, deprecated.
http://www.google.com/search?hl=en&s...ecated&spell=1

Bob Lehmann

"MyndPhlyp" <no****@homerig ht.now> wrote in message
news:ur******** ******@TK2MSFTN GP14.phx.gbl...

"Adrienne" <ar********@sbc global.net> wrote in message
news:Xn******** *************** *****@207.115.6 3.158...

Yes, stop using the target attribute. The target attribute is deprecated except for the Frameset element.


I have found nothing indicating that the target attribute in anchors is
depreciated. The HTML 4.01 specifications do not show it depreciated plus
the W3 HTML Validator for DOCTYPES XHTML 1.0 Transitional and HTML 4.01
Transitional does not flag it as depreciated.

Cite your source.

(But yes, removing the target attribute does cure the symptom. Thanx.)

Jul 22 '05 #5

"Bob Lehmann" <no****@dontbot herme.zzz> wrote in message
news:Oj******** *******@TK2MSFT NGP09.phx.gbl.. .
You're right. It's not depreciated. Attributes retain their value throught
their lifetime.

It is, however, deprecated.

http://www.google.com/search?hl=en&s...ecated&spell=1

ROFL - and every time I have read "deprecated " my fogged brain plugged in
"depreciate d." 'Bout time I was shown the error of my ways. Thanx.

I did do a little more digging. While the HTML 4.01 Specifications did not
list anything there were some other pages over at W3 that suggest one should
refrain from using it, seemingly primarily because of all the pop-up
blockers popping up (at the risk of sounding redundant). Maybe some day W3
will get around to adding that check in their HTML Validator. (Hey, it's
free so don't complain.)

One thing I don't understand is that W3 is still in favor of frames - an
element (structure?) not held in the highest respect among some circles
(and, to some, found to be akin to the blink tag that thankfully was never
fully embraced). I would have expected them to phase out frames before the
ability to spawn another browser instance. Ah well ... onwards.
Jul 22 '05 #6
It is deprecated, but I wouldnt worry about it too much. Target attributes
are going to keep working for a long time and you are going to see then used
all over the place.
"MyndPhlyp" <no****@homerig ht.now> wrote in message
news:%2******** *******@TK2MSFT NGP10.phx.gbl.. .

"Bob Lehmann" <no****@dontbot herme.zzz> wrote in message
news:Oj******** *******@TK2MSFT NGP09.phx.gbl.. .
You're right. It's not depreciated. Attributes retain their value
throught
their lifetime.

It is, however, deprecated.

http://www.google.com/search?hl=en&s...ecated&spell=1

ROFL - and every time I have read "deprecated " my fogged brain plugged in
"depreciate d." 'Bout time I was shown the error of my ways. Thanx.

I did do a little more digging. While the HTML 4.01 Specifications did not
list anything there were some other pages over at W3 that suggest one
should
refrain from using it, seemingly primarily because of all the pop-up
blockers popping up (at the risk of sounding redundant). Maybe some day W3
will get around to adding that check in their HTML Validator. (Hey, it's
free so don't complain.)

One thing I don't understand is that W3 is still in favor of frames - an
element (structure?) not held in the highest respect among some circles
(and, to some, found to be akin to the blink tag that thankfully was never
fully embraced). I would have expected them to phase out frames before the
ability to spawn another browser instance. Ah well ... onwards.

Jul 22 '05 #7

"Kyle Peterson" <kp*****@hotmai l.com> wrote in message
news:%2******** *********@TK2MS FTNGP15.phx.gbl ...
It is deprecated, but I wouldnt worry about it too much. Target attributes
are going to keep working for a long time and you are going to see then used all over the place.


Yep. I use them quite a bit myself when a link goes out of the site. Thanx
again.
Jul 22 '05 #8
Gazing into my crystal ball I observed "MyndPhlyp" <no****@homerig ht.now>
writing in news:uI******** ******@TK2MSFTN GP14.phx.gbl:

"Kyle Peterson" <kp*****@hotmai l.com> wrote in message
news:%2******** *********@TK2MS FTNGP15.phx.gbl ...
It is deprecated, but I wouldnt worry about it too much. Target
attributes are going to keep working for a long time and you are going
to see then used all over the place.


Yep. I use them quite a bit myself when a link goes out of the site.
Thanx again.


The reason the target attribute is deprecated for documents not in a
frameset is because it breaks that back button.

I use mouse gestures and am happily gesturing back when I realize nothing
is happening, then I look up and see the back button is disabled.

For some users this can be disorienting or confusing. Further, on some
systems with little resources, spawning a new window can be slow and eats
up even more resources.

Most people know how to use the back button, or back space, or gesture
back. Please don't break the browser's fuctionality. If the person
wants to go back to your site, they will.

--
Adrienne Boswell
http://www.cavalcade-of-coding.info
Please respond to the group so others can share
Jul 22 '05 #9
I am sorry but that is just plain stupid.
About as stupid as replaying to posts at the bottom of the message instead
of the top.
"Adrienne" <ar********@sbc global.net> wrote in message
news:Xn******** *************** *****@207.115.6 3.158...
Gazing into my crystal ball I observed "MyndPhlyp" <no****@homerig ht.now>
writing in news:uI******** ******@TK2MSFTN GP14.phx.gbl:

"Kyle Peterson" <kp*****@hotmai l.com> wrote in message
news:%2******** *********@TK2MS FTNGP15.phx.gbl ...
It is deprecated, but I wouldnt worry about it too much. Target
attributes are going to keep working for a long time and you are going
to see then used all over the place.


Yep. I use them quite a bit myself when a link goes out of the site.
Thanx again.


The reason the target attribute is deprecated for documents not in a
frameset is because it breaks that back button.

I use mouse gestures and am happily gesturing back when I realize nothing
is happening, then I look up and see the back button is disabled.

For some users this can be disorienting or confusing. Further, on some
systems with little resources, spawning a new window can be slow and eats
up even more resources.

Most people know how to use the back button, or back space, or gesture
back. Please don't break the browser's fuctionality. If the person
wants to go back to your site, they will.

--
Adrienne Boswell
http://www.cavalcade-of-coding.info
Please respond to the group so others can share

Jul 22 '05 #10

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

Similar topics

1
5253
by: Navin | last post by:
i open the file download.asp from another main.asp page using window.open what the problem is when i clikc on the hyperlink it prompts me the ie save dialog box taht fine. but when the script ends in download.asp i wanna close the download.asp .asp window open in background.. but that not working. how to close the window download.asp as i wanna save the content in text format i dont wnat to use the body unload event handler as the
2
2900
by: Gary D. Rezek | last post by:
Hi All, First of all I'm mostly an MS Access guy (and novice learning MSSQL guy) and put on this project because of personnel changes, etc and because of db experience. I've only been doing this for about 2 months. I need to know how to "force" a download (patch) from an ASP page. I am developing an on-line internet registration page for students in the Residence Halls. Part of this project is getting their Res Hall/room number/port, MAC...
6
8539
by: chon | last post by:
I have an ASP page that is sent a file location as a parameter. It opens this file, loads the ADODB.Stream object and does a binary write to the page forcing the download dialog to appear. This all works fine. If the user selects "Open" or "Cancel", the window closes, which is the desired behavior. If they select "Save", the location dialog shows up, they save the file and the window remains open. I've tried a number of things to get...
6
4608
by: No_Excuses | last post by:
All, I am interested in reading the text of a web page and parsing it. After searching on this newgroup I decided to use the following: ******************************* START OF CODE ************************ String sTemp = "http://cgi3.igl.net/cgi-bin/ladder/teamsql/team_view.cgi?ladd=teamknights&num=238&showall=1"; WebRequest myWebRequest = WebRequest.Create(sTemp); WebResponse myWebResponse = myWebRequest.GetResponse();
13
2321
by: Mickey | last post by:
Hi all, Currently I use a timestamp to log users out after 15 minutes of inactivity. However I also need to log a user out if they have just left the page. I need to do this because I store current online users in a database, allowing a maximum of 5 users at one time. I have been looking through the php manual and came across session_cache_expire(). This isn't doing what I need either. Am I
2
1427
by: comp.lang.php | last post by:
if ($forceDownload) { // HANDLE FORCED DOWNLOAD $dlGen =& new DownloadGenerator($fullFilePath); $negativeIndex = $dlGen->generateForceDownloadHeaders(); $willDeleteTemp = $dlGen->getSession('willDeleteTemp'); if (!$dlGen->isSuccessful) $errorArray = $dlGen->getErrorArray(); if ((int)$negativeIndex !== -1 && $willDeleteTemp) { if ($dlGen->getSession('album')) { $locationPath = "${'tmp' . ucfirst($dlGen->getSession('section'))...
14
1815
by: Simon Rigby | last post by:
Hi folks, I appreciate that this topic of forced downloads has been discussed in various threads but my situtation is a little different to those that I have come across and am experiencing a wierd issue in IE6. Essentially I am executing a select query against a MySql database and taking the result of that query and building a csv stream on the fly to send to the browser as a forced download.
12
2849
by: comp.lang.php | last post by:
index.php: // STUFF // STEP 1: imagecreatetruecolor ONLY IF GD 2.0+ SUPPORTED AND FOUND if ($this->isSuccessful && !$hasMogrified && $image && !$newImage && function_exists('imagecreatetruecolor') && preg_match('/2\.0/i', $this->gd_info_array)) { $newImage = @imagecreatetruecolor($configArray, $configArray);
0
9706
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
10583
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
10337
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...
0
10082
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
5525
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
5654
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4301
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
2
3822
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2995
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.