I've searched and searched but can't seem to find a way to upload files to my twisted.web application in any reasonable way.
Currently, posting file uploads to a resource results in a request.args['file']
variable, that is a list populated with file contents. I can't find a way to get any information about the file: mime type, filename, filesize (other than just taking the length of the strings in args['file'][]
), etc.
I have read that twisted.web2 is better at file uploads. However I don't know how much better it is, or how I would use twisted.web2 to handle file uploads in a twisted.web application.
Any suggestions? This is bugging me like crazy -- Oh and I looked at the request headers, and didn't really find anything of any significance. How can I get some more meta information about file uploads with Twisted?
Also,
How can I just get the bare HTTP request from a request object? Is it possible?