Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re (tilly) 2: Not listening.

by tilly (Archbishop)
on Feb 10, 2001 at 11:25 UTC ( #57595=note: print w/ replies, xml ) Need Help??


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.


Comment on Re (tilly) 2: Not listening.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://57595]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (7)
As of 2014-12-28 19:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (182 votes), past polls