I've run through the archives looking for as much as I can regarding a CGI or mod_perl file upload progress bar, and seen the same thing over and over again. "We're simply not sure." Basically, what I'm looking for right now is to possibly outline the situation I am facing, where I am, and to possibly hear a couple well thought-out suggestions, possibly a curmudgeoney answer, possibly a funny answer, i'd like a cute answer and heck maybe even a plain old spiteful answer.

Basically the long and short of what I'm dealing with is that I heard the words, "I like the app so far, but some people complain that when they upload a large file they can't tell if anything's actually happening. Any chance you can come up with a Progress Bar?"( ::sfx - Jarring Chord as men in white coats stand outside my office door waiting for me to crack :: ). I'm looking for a perl way to do this. The people who are going to be using this interface are not the type of people who would be apt to installing a plug-in, and let's be honest, javascript just leaves a funny smell on our hands.

I've been using mod_perl for this and what I've noticed is as far as I can tell, within a multipart/form-data submission the contents of the file are actually transmitted once you hit the submit button. Hence, I can't get a request to be handled and start counting the temporary file before the file even finishes uploading. I simply don't get to touch the process before it's uploaded. This is where I'm stubbing my toe against the situation. Every answer I can come up with has to assume this fact isn't there.

I keep trying to think of a way I can beat that request to the punch. To have something waiting to grab that information first, gather the total size of the file being sent, then start counting as the temporary file fills up. This way I can return information in the form of an on-the-fly GD Image as the file is being uploaded. However, I'm not even sure if this is a perl issue so much as hack on Apache.

I'm pretty much out of steam right now. More will come to me if this gets any discussion.

Macphisto
Everyone has their demons...you just happen to be mine.

In reply to 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.