[Web-SIG] a new implementation of multipart/form-data parser
manlio_perillo at libero.it
Wed Sep 10 20:02:04 CEST 2008
For my WSGI framework I have implemented a multipart/form-data parser.
The code has been adapted from cgi.parse_multidata.
I think that the function is more robust of FieldStorage, since you can
set a max size for field data stored in memory.
The code is more simple, too (since I have done a little review of
current browsers behaviour, and none of them use multipart/mixed when
encoding multiple file fields with the same name).
Now I'm going to write a middleware that takes a POST request with data
encoded in multipart/form-data, and transcode the request entity in
application/www-form-urlencoded, with file fields saved as:
where <path> is the temporary path where the file has been stored.
Note that there is a Nginx module
that does this (but don't transcode in application/www-form-urlencoded.
Any one interested?
I really whould like some reviews.
Thanks Manlio Perillo
More information about the Web-SIG