From: Ben Darnell Date: Sat, 4 Sep 2010 19:19:46 +0000 (-0700) Subject: Add more documentation for request.files. X-Git-Tag: v1.1.0~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=890d829171e1c33e7b570d1a2a5a911bb45e47e2;p=thirdparty%2Ftornado.git Add more documentation for request.files. --- diff --git a/website/templates/documentation.txt b/website/templates/documentation.txt index 9f2171e43..357c63bcd 100644 --- a/website/templates/documentation.txt +++ b/website/templates/documentation.txt @@ -154,6 +154,11 @@ You can get query string arguments and parse `POST` bodies with the self.set_header("Content-Type", "text/plain") self.write("You wrote " + self.get_argument("message")) +Uploaded files are available in `self.request.files`, which maps names +(the name of the HTML `` element) to a list of +files. Each file is a dictionary of the form `{"filename":..., +"content_type":..., "body":...}`. + If you want to send an error response to the client, e.g., 403 Unauthorized, you can just raise a `tornado.web.HTTPError` exception: