cgi.fieldstorage()

gert gert.cuykens at gmail.com
Fri Jul 24 13:22:36 EDT 2009


this is a non standard way to store multi part post data on disk

def application(environ, response):
    with open('/usr/httpd/var/wsgiTemp','w') as f:
        while True:
            chunk = environ['wsgi.input'].read(8192).decode('latin1')
            if not chunk: break
            f.write(chunk)
    response('200 OK',[])
    return ['complete']

my question is how do i handle the file, so i can shuffle it into a db
using small chunks of memorie ?



More information about the Python-list mailing list