Those Twisted Filenames

Twisted can't give file-upload filenames to the running app. It just passes the 'value' (file content) to the application.

This is kind of bad for AttachFile.

I created two derived classes MoinSite and MoinRequest. Request is derived from twisted.server.Request. It overrides the method requestReceived to parse the form data more carefully (using cgi.FieldStorage) and adds the filenames to the args dict as FIELDNAME__filename__ (as the other Requests depending on FieldStorage do).

This MoinRequest is set als requestFactory of the MoinSite, which is derived from twisted.server.Site and has no other changes.

This enables the MoinMoin Twisted server to handle file-upload filenames.

Added to moin--main--1.2. -- ThomasWaldmann 2004-01-10 17:15:51

MoinMoin: OliverGraf/ThoseTwistedFilenames (last edited 2007-10-29 19:07:34 by localhost)