MCPcopy
hub / github.com/pallets/werkzeug / view_file

Function view_file

examples/upload.py:8–14  ·  view source on GitHub ↗
(req)

Source from the content-addressed store, hash-verified

6
7
8def view_file(req):
9 if "uploaded_file" not in req.files:
10 return Response("no file uploaded")
11 f = req.files["uploaded_file"]
12 return Response(
13 wrap_file(req.environ, f), mimetype=f.content_type, direct_passthrough=True
14 )
15
16
17def upload_file(req):

Callers 1

applicationFunction · 0.85

Calls 2

ResponseClass · 0.90
wrap_fileFunction · 0.90

Tested by

no test coverage detected