[mod_python] Mike's psp upload

Mike Looijmans nlv11281 at natlab.research.philips.com
Mon Feb 20 01:55:19 EST 2006


I've looked into it further and the problem is that the FileCounter is not a FileType class. The 
current implementation only works for classes that inherit from FileType. Which is slightly more 
useful than without the callback, but not very Pythonic (even broken, I think).

I'll take this issue to the developer list.

(Oh, and remove the reference to 'fmt.py' which I forgot to strip out)

Mike Looijmans
Philips Natlab / Topic Automation


Mike Looijmans wrote:
> Hmm. I tested and indeed, the program does not work any more.
> 
> The problem is NOT that FileCounter does not supply a read() method 
> though. There's no reason for any object to 'read' the file, it's just 
> writing it.
> 
> The problem is that mod_python seems to have forgotten somewhere that 
> this is a file upload and not a simple name=value pair. You would not 
> want to upload a 1GB file with this - it will eat 1GB of RAM for that. 
> Looks like an old bug has returned to bite us.
> 
> Mike Looijmans
> Philips Natlab / Topic Automation
> 
> 
> Daniel Nogradi wrote:
> 
>> Mike Looijmans has posted not so long ago a potentially very useful
>> psp script to handle 'streamed' file uploads:
>> http://modpython.org/pipermail/mod_python/2006-February/020248.html
>>
>> With the latest mod_python 3.2.7 installed it doesn't work because the
>> FileCounter class has no method 'read' which is apparently needed by
>> util.py (makes sense, one wants to be able to read the content of the
>> uploaded file). Is that example script really broken or am I missing
>> something?
> 
> 
> 
> _______________________________________________
> Mod_python mailing list
> Mod_python at modpython.org
> http://mailman.modpython.org/mailman/listinfo/mod_python



More information about the Mod_python mailing list