Closing the pop up and downloading a file simultaneously

A

Anitha

Hello All,

Using Javascript and using one click, I have to close the window(pop
up) and start the download of a file simultaneously.

There will be a hyperlink in a pop up window as "Click here to start
the download". When the user clicks on it, this pop up window should
close and the file(which is behind the screen) will start to download.

Can someone please tell me how to do this or point me to the right
website where I can find an answer to this question?

Thanks
 
D

Dominique

in the main window:

function startDownload() {
do whatever e.g document.location = filename etc...
}

in the pop-up window:

(this is the onlick event for the "click here to start....")

function startDownload() {
window.opener.startDownload();
self.close()
}
 
A

Anitha

Thanks, your idea works.

But I want to download .ppt files in IE and Netscape. For .ppt files,
the file opens but immediately goes to the slideshow mode and so the
user can only view and not download the file.

How do I make them save the .ppt file?

OR

Now what I want to do is, open the .ppt in a new window(as opposed to
open it in the main window) and somehow make them download or open the
file not in slideshow mode.

Can you please help me with this?

Thanks
 

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

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,906
Latest member
SkinfixSkintag

Latest Threads

Top