Closing the pop up and downloading a file simultaneously

Discussion in 'Javascript' started by Anitha, May 6, 2004.

  1. Anitha

    Anitha Guest

    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
     
    Anitha, May 6, 2004
    #1
    1. Advertising

  2. Anitha

    Dominique Guest

    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()
    }

    "Anitha" <> wrote in message
    news:...
    > 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
     
    Dominique, May 6, 2004
    #2
    1. Advertising

  3. Anitha

    Anitha Guest

    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

    "Dominique" <> wrote in message news:<c7e8qb$sd0$>...
    > 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()
    > }
    >
    > "Anitha" <> wrote in message
    > news:...
    > > 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
     
    Anitha, May 7, 2004
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?Vk1J?=

    Closing popup window when closing parent window?

    =?Utf-8?B?Vk1J?=, Feb 14, 2007, in forum: ASP .Net
    Replies:
    3
    Views:
    681
    Thomas Hansen
    Feb 15, 2007
  2. ids
    Replies:
    4
    Views:
    1,567
    Keith Thompson
    Apr 14, 2009
  3. Pallav singh
    Replies:
    6
    Views:
    2,028
    James Kanze
    Jun 14, 2009
  4. samppi
    Replies:
    27
    Views:
    553
    David A. Black
    Dec 5, 2007
  5. Anitha
    Replies:
    0
    Views:
    95
    Anitha
    May 10, 2004
Loading...

Share This Page