in reply to Keep track of running CGI script
create a temp file. Every $percent_mark records, append a character to the file.
Return a marker for the temp file in the cgi response, so the JavaScript call points to correct file:
Then, when you call the counter.cgi file, percentage complete is:<SCRIPT LANGUAGE="JavaScript> setTimeout(30000,"top.display_frame.location.href= 'counter.cgi?tmpfil +e=temp_file_name';"); </SCRIPT>
Return this in your display frame along with JS above.my $percent_complete = stat(temp_file_name)[7];
Amend to suit - only my .02
cLive ;-)
PS - if it really takes an hour, you might want to set a cookie and tell them to check back later - and use the cookie to identify them in the script.
|
|---|