<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><DIV>Hello!</DIV><DIV><BR class="khtml-block-placeholder"></DIV>I am more a PHP programmer than an JavaScript expert. So, please be patient with me. Is there a way to show a progress bar when the user is waiting for a download?<DIV><BR class="khtml-block-placeholder"></DIV><DIV>On one of my pages users can download dynamically generated PDF documents by clicking on a normal &lt;a&gt; link. Generating a PDF document would usually take between three and six seconds. When the document is ready, it will be downloaded automatically (the document will not be shown in the browser) by sending an "<FONT class="Apple-style-span" face="Arial" size="3"><SPAN class="Apple-style-span" style="font-size: 13px;">application/</SPAN></FONT><FONT class="Apple-style-span" face="Arial" size="3"><SPAN class="Apple-style-span" style="font-size: 13px;"><B>octet</B></SPAN></FONT><FONT class="Apple-style-span" face="Arial" size="3"><SPAN class="Apple-style-span" style="font-size: 13px;">-</SPAN></FONT><FONT class="Apple-style-span" face="Arial" size="3"><SPAN class="Apple-style-span" style="font-size: 13px;"><B>stream</B></SPAN></FONT>" header. When the server begins outputting the document, it also sends a redirect to the original page. So basically, the user is never leaving the page with the download links. I would like to show some kind of progress bar or just a DIV with a simple text.<BR><DIV><BR class="khtml-block-placeholder"></DIV><DIV>All scripts for progress bars I found on Google are dealing with the problem that is when a user is waiting for a page to load completely (most of them using the "onLoad" event in the body tag). Waiting for a download to begin seems to be a different problem. I was not able to use "onUnload" in the body tag because the download will never trigger this event.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>My idea is to have a script that is supposed to:</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>a) show a DIV when the user clicks on a link</DIV><DIV>b) scans/waits for a octet stream to begin</DIV><DIV>c) when the octet stream is detected (or when the redirect is detected), hide the DIV.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Hope you get my point. Any ideas / suggestions are welcome!</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Regards,</DIV><DIV>/frank</DIV></DIV></BODY></HTML>