I've seen this done quite a bit using servlets and ASP, but never using Perl :(

As far as I can tell here's the basic idea:

Put a onSubmit javascript handler so that when the form is submitted, a new window is opened calling say progress.cgi

The original page then goes ahead and submits the form, somehow you have to capture the total size of the file before it is uploaded and store it somewhere (perhaps in a database) so progess.cgi could access it.

The progress window is then set to refresh every say 2 seconds, when it does it checks the temporary file size and grabs the total size out the database. Then you can make up an image or whatever your after.

There is a demo (regrettably not in Perl but VBScript) here

I have been meaning to look into something like this for a while but havn't had the time, so please keep us informed of your progress (no pun intended)


In reply to Re: Yet another progress bar. by Nomis52
in thread Yet another progress bar. by Macphisto

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.