From 890d829171e1c33e7b570d1a2a5a911bb45e47e2 Mon Sep 17 00:00:00 2001 From: Ben Darnell Date: Sat, 4 Sep 2010 12:19:46 -0700 Subject: [PATCH] Add more documentation for request.files. --- website/templates/documentation.txt | 5 +++++ 1 file changed, 5 insertions(+) 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: -- 2.47.2