PDA

View Full Version : direct output to new Window/(iframe)



edikaufmann
12-31-2005, 08:50 AM
Environment: W2kServer, IExplorer6, VS.NET 2003
Application: two-frame window: name="content" src="c.aspx" and name="main" src="m.aspx"

In 'c.aspx' I issue:window.location.href = "ftp://..../SOS.doc" (or .xls, .pdf etc)

The 'ftp' in turn correctly gives me the 'File Download' prompt to either 'open' or 'save' the downloaded file.
All is ok when I opt to 'save'. When I opt to 'open' the file shows up in the 'content'-iframe --> However, I'd rather have it in the 'main'-iframe or even better a NEW window alltogether.

A) 'main'-iframe:
how can I, after I issued the 'ftp://...' command, direct the focus to the 'main'-iframe in order to receive the output there?
B) NEW window
how can I force to open a brand new window to receive the file?

Or is there any other trick to achieve either one?

... I'm pretty sure in the end is an easy thing ...?

Many thanks for your time and hints
ed

jscheuer1
12-31-2005, 10:39 AM
I'm not sure how this will work in conjunction with aspx and ftp addresses but, it should be fine. It is how these things would normally be done so, worth a shot. To open in main:


window.parent['main'].location.href='ftp://..../SOS.doc'

To open in a new window:


window.open('ftp://..../SOS.doc')

The thing I am least clear on is if these commands will bring up the save/open prompt or not. Give them a try and see what happens.

Note: The brackets, quotes and parenthesis used in the code are literal, do not remove them when trying this out.

edikaufmann
01-01-2006, 09:56 AM
Hi John,
Thank you. All is ok now. I use now:

window.open(FTPpath) ' "main" being the frame name!

This way I get now a new IE window AND the 'File Download' prompt!

When using below statement I'm fine too, however, there is a different behavour dependent on how the 'Folder Options' are set! (see Folder options- filet ypes- e.g..doc - advanced - !combination of 1st and last tick marks!.

window.parent.main.location.href=FTPpath ' "main" being the frame name!

Thanks again and have good 2006
ed