1.1 --- a/examples/Common/Form/__init__.py Sat Oct 27 21:26:46 2007 +0000
1.2 +++ b/examples/Common/Form/__init__.py Sat Oct 27 21:27:04 2007 +0000
1.3 @@ -136,9 +136,17 @@
1.4 # Detect uploads.
1.5
1.6 if type(value) not in (type(""), type(u"")):
1.7 - value = "%s: %s" % (value.headers.get("content-type") or "No content type", repr(str(value)))
1.8 + value.stream.reset()
1.9 + details = "%s of length %s: %s" % (
1.10 + value.headers.get("content-type") or "No content type",
1.11 + value.headers.get("content-length") or "Unknown",
1.12 + repr(value.stream.read(20))
1.13 + )
1.14 + else:
1.15 + details = value
1.16
1.17 - l2.append("<li>%s</li>" % (value.replace("&", "&").replace("<", "<").replace(">", ">") or "<em>empty</em>"))
1.18 + l2.append("<li>%s</li>" % (details.replace("&", "&").replace("<", "<").replace(">", ">") or "<em>empty</em>"))
1.19 +
1.20 return "".join(l2)
1.21
1.22 # vim: tabstop=4 expandtab shiftwidth=4