I've only just started dabbling with mod_perl, but it looks like Apache::Request->new's UPLOAD_HOOK argument might be of use...

UPLOAD_HOOK

Sets up a callback to run whenever file upload data is read. This can be used to provide an upload progress meter during file uploads. Apache will automatically continue writing the original data to $upload->fh after the hook exits.

However, I think the real trick will be "streaming" your progress meter back to the client as I've never had much luck in getting the browser to read anything back from the window or frame it's uploading to until after the upload is done.

However, mod_perl certainly gives you a much finer control of interaction than CGIs, so you might have some joy there or with nph although personally I've had much success using multiple windows (the progress window being launched via JavaScript) or frames, and then employing some sort of communication between the upload and progress processes, with the window/frame for the latter refreshing often.

    --k.



In reply to Re: Yet another progress bar. by Kanji
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.