We've been using the uploadfilter.py that is specified in the
TurboGears doc site.  Having upgraded from CherryPy 2.2.1 to 2.3.0 our
code broke.  In a previous thread I'd mentioned a 1 line fix, it turns
out that there is an additional configuration step for CherryPy 2.3.0.

The doc page is:
http://docs.turbogears.org/1.0/FileUploadProgressBar
and uploadfilter.py is linked from there via:
http://docs.turbogears.org/1.0/FileUploadProgressBar?action=AttachFile&do=get&target=uploadfilter.py

The fix to uploadfilter.py for CherryPy 2.3.0 is to remove line 223:
    if upload_maxsize:
        upload_maxsize *= 1024
        cherrypy.thread_data.upload_maxsize = upload_maxsize
        size = float(cherrypy.request.headers['Content-length'])
        if size > upload_maxsize:
            raise Upload_MaxSizeError
        cherrypy.request.rfile = cherrypy.request.rfile.rfile # REMOVE
THIS LINE (line 223)

For configuration I noted that for files <100mb the uploads are fine,
for files >100mb a HTTPError(413) is raised.  The fix is to add
server.max_request_body_size to your dev.cfg/prod.cfg e.g.:
server.max_request_body_size = 500000000 # 500mb, specified in bytes

Comments on the docs.turbogears page are closed - if I ought to raise
a ticket somewhere (Florent?) then just point me in the right
direction.

Cheers,
Ian.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to