in reply to
Re: Not listening.
in thread File upload progress?
I have never done anything like this, and indeed my first
response would be to say "impossible" meaning "if doable,
much harder than you want". However it probably is
possible to do this.
Were I to tackle this project (after appropriate moaning
and groaning) I would crack open the source-code to
CGI, and look for the file-upload part. That
seems to be in a function called read_multipart. I would
then create (ick) a private version of the module with a
hook in that function to, based on a flag, launch a nph
response and stream upload information back. Or to stream
upload information back to a predictable place (based on a
random ID sent to the client and returned in an obvious
place - eg PATH_INFO) so that the client can have the second
window going. (That is probably the saner approach to
implement. Besides which the server may not be expected
the CGI script to reply while the upload is going on, so
the second window may be the only easy response.)
I would expect that since file uploads can be large, there
would be no way that a decent webserver would accumulate
the entire upload before starting the CGI.
Anyways figuring how to modify the existing CGI module to
have the hook is going to be a lot easier (and better)
than rolling from scratch, even though the hook will be
so ugly that there is little chance it will be accepted back
into the module.
There may be other ways to do it using HTTP negotiation etc.
But the hack I described can probably work.