[mod_python] capturing uploaded file with progress info...

Eric St-Jean esj at wwd.ca
Thu Jan 13 12:04:11 EST 2005

answering to myself, i might have found a way: use a PUT method in the 
form to upload the file to a specific place on the server, and when the 
client's popup reloads, i just check the size of the file so far. i'd 
use an authhandler to check each PUT request to make sure i was waiting 
for it. i haven't tried it yet, but it sounds feasible.

does anyone have any comments? code examples? experiences?
it would be much appreciated...

i also saw that i could do this in mod_python 3 with an input filter, 
but i'd prefer something that works with apache 1.x as well, if i can 
help it, as many many people, including myself, have been sticking with it.

thank you!

Eric St-Jean wrote:

> i have a form, to upload a file to the server through 
> mod_python/apache, on a debian stable server (apache 1.3.26-0woody6, 
> mod_python 2.7.8-0.0woody2, i386). it works perfectly fine.


> a- i have no idea - and i've really looked in a lot of places and 
> tried many things! - how to get information on how much data has been 
> transferred, and how much the client said there would be! actually: i 
> know how much he said there would be, as i have a headerparserhandler 
> which sees the Content-Length; but i don't know how to get the current 
> amount of data transferred
> b- in the end, i get a file object, but i can't just move it (is it a 
> pipe? a socket?), so i need to make a copy; this all seems very 
> wasteful, to have apache get the file, put it in a tmp place, then me 
> in mod_python copy the entire file over, and later on apache deleting 
> its temp file...


Éric St-Jean                           eric.st-jean at carmensystems.com
               Modeling Engineer, Carmen Systems Ltd.
       1800 McGill College Avenue, Montreal, QC, Canada H3A 3J6
+1(514)282-1800 ext.116 http://carmensystems.com  fax +1(514)282-1750

More information about the Mod_python mailing list