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.
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:
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, 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, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||