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.