Zarabozo has asked for the wisdom of the Perl Monks concerning the following question:
Dear Monks:
I'm trying to develop something that can let me show a progress bar or a progress percentage field when a user uploads a file to my server.
I'm working over mod_perl 2 (with Apache 2.2). So far, I have only found ways to read the uploaded file using CGI.pm or by reading the request directly (e.g. $r->read($buffer, $ENV{CONTENT_LENGTH}).
However, I'm not getting anywhere with this, since Apache seems to read all the request body before my script can even do anything. So, by the time my handler finally starts processing the upload, the file is already in the server (meaning Apache has already read the entire request body), so all I can return is "100% loaded".
I'm looking for help on how to be able to make a mod_perl handler do its processing while Apache is actually reading the request, so I can make it store the progress somehow (e.g. in a database based on a request id) and letting a different request (e.g. some AJAX code) retrieve the actual progress of the file upload.
Can anybody please help me with some wisdom?
Thank you very much.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Uploading files showing a progress bar - Apache 2.2 and mod_perl
by Anonymous Monk on Apr 08, 2011 at 06:15 UTC |