"Content-Disposition: attachment" Problem with XP Service Pack 2

G

Guest

I have recently installed Service Pack 2 for Windows XP
but I'm having problems when I need to download a file
with Internet Explorer 6 in and ASP application.

The source code of my asp is like this:

'ContentType specifies the MIME type of this header.
Response.ContentType = "text/plain"

'The AddHeader method adds an HTML header with a specified
value. Content-disposition forces the browser to download.

Response.AddHeader "content-disposition", "attachment;
filename=filexxx.txt"

Internet Explorer prompt the user to save the file (a text
file), but after I save or open the text file on my
computer the browser window is closed.

Best regards,

Paulo Marcelino
 
G

Guest

I am having the same problem.

Sending the "content-disposition: attachment; filename=filename" header to
any frame causes the browser window to shut down after the open/save
dialog closes when the browser is IE6 on Window XP SP2.

Other versions of IE are fine. This has to be a bug. I feel like SP2 was
rushed out the door, as this is one of many bugs I have run across.

My workaround is execute the following JavaScript when the HtmlInputButton
that starts the download is clicked. The JavaScript changes the form target
to the parent window, posts back, and then changes the form target back
to _self.

window.document.forms[0].target = window.parent.name;
__doPostBack('MyButton','');
window.document.forms[0].target = '_self';
 
G

Guest

Hannagan said:
I am having the same problem.

Sending the "content-disposition: attachment; filename=filename" header to
any frame causes the browser window to shut down after the open/save
dialog closes when the browser is IE6 on Window XP SP2.

Other versions of IE are fine. This has to be a bug. I feel like SP2 was
rushed out the door, as this is one of many bugs I have run across.

My workaround is execute the following JavaScript when the HtmlInputButton
that starts the download is clicked. The JavaScript changes the form target
to the parent window, posts back, and then changes the form target back
to _self.

window.document.forms[0].target = window.parent.name;
__doPostBack('MyButton','');
window.document.forms[0].target = '_self';

I am having the exact same problem, any solutions?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top