content-dispositon, attachment and frames?

  • Thread starter Johan Torstensson
  • Start date
J

Johan Torstensson

Hi,

I've noticed that IE6 on Windows Xp with SP2 sometimes closes the browser
window after the open/save dialogue.

The problem seems only to occur when using the header "Content-Disposition",
"attachment; filename=thefilename.txt" and when the browser window is a
child of another window and when the download link is on a page inside a
frame.

In my case the users log on to the system and from a portal-page they click
their way to diffent projects, which are opened in new windows (making them
childs of the "portal" browser window). The project page is a frameset. When
downloading a file from here the browser window closes.

The problem dissapears when loading the project page directly in a new
browser, from a bookmark or if the user types the url manually. But this is
not the general approach of my users, they come in using the portal, as it
was intended.


I've seen a few posts about similar problems here and there, but I've never
seen any solutions. Anyone got any ideas?


Thanks
Johan
 
M

Michael Henry

Johan,

I have your exact same problem with my app for our users that have
moved to SP2. My app is launched from a portal. When a user clicks
my report download link, after the report is downloaded, my app
closes. I've recreated the problem even without a frame in the app
window. I send my reports back with the attachment
Content-Disposition. The best I could find to get around the problem
is do a window.open("downloadlink"), but this opens a browser window
which is annoying. If anyone has a solution to this please help, it's
driving me crazy trying to find a workaround.

Thanks,
- Mike Henry
 
G

Guest

Michael Henry said:
I have your exact same problem with my app for our users that have
moved to SP2. My app is launched from a portal. When a user clicks
my report download link, after the report is downloaded, my app
closes. I've recreated the problem even without a frame in the app
window. I send my reports back with the attachment
Content-Disposition. The best I could find to get around the problem
is do a window.open("downloadlink"), but this opens a browser window
which is annoying. If anyone has a solution to this please help, it's
driving me crazy trying to find a workaround.

From what I have seen, the bug occurs only within frames.

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';
 

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