Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Fellow Monks:
Here is the gist of what I am trying to accomplish and the stumbling block (hopefully minor) that I have encountered. I am creating a data download tool that interacts with a database. The user selects the data items and time range then submits the request through the HTML/CGI web interface. The selected variables/info are transfered to the associated perl script which downloads and presents the data via an anonymous ftp link. When the data request is submitted to the script a popup-progress window is generated indicating that the download is in-progress.
Now normally when the process is initiated for small to medium sized data requests the perl script, as planned returns to the progress popup the display note the the download is done and provides a link to the data. This is good to go up to about 5 minutes or so of wait time. With larger downloads the script continues to run, but from what I can guess the window times out and the connection between the progress window and script is lost such that when the script is done and the data with directory is created the script is unable to communicate back to the original window the final data location.
Ultimately The question is: What do I need to do, what little snippet of code do I need to implement to keep this communication link alive for a time on the order of 30+ minutes or so??
Any help and or insight that you can provide would be greatly appreciated... I am thinking that this is probably something very simple that I just don't know about yet. Thanks in advance for your help.

Replies are listed 'Best First'.
Re: Keeping a popup progress window alive
by derby (Abbot) on Aug 14, 2006 at 16:11 UTC

    The normal way to do this is embed a meta refresh tag in the status page. The action of the refresh would check to see if the download is available ... if it is, show the download page, if not show the status page. merlyn has a article about this.

    -derby
Re: Keeping a popup progress window alive
by friedo (Prior) on Aug 14, 2006 at 16:09 UTC
    You're not going to be able to prevent the browser from timing out on a single connection. Even if you could, it probably wouldn't work on all browsers. Instead, I think the best strategy for this type of thing is to report the progress to a database. Then, you can have your popup window run a script to check the database for progress and reload itself every 10 seconds or so.