Method: flask.debughelpers.DebugFilesKeyError.__init__
Calls: 1, Exceptions: 0, Paths: 1Back
Path 1: 1 calls (1.0)
Request (1)
'foo' (1)
1def __init__(self, request, key):
2 form_matches = request.form.getlist(key)
3 buf = [
4 f"You tried to access the file {key!r} in the request.files"
5 " dictionary but it does not exist. The mimetype for the"
6 f" request is {request.mimetype!r} instead of"
7 " 'multipart/form-data' which means that no file contents"
8 " were transmitted. To fix this error you should provide"
9 ' enctype="multipart/form-data" in your form.'
10 ]
11 if form_matches:
12 names = ", ".join(repr(x) for x in form_matches)
13 buf.append(
14 "\n\nThe browser instead transmitted some file names. "
15 f"This was submitted: {names}"
16 )
17 self.msg = "".join(buf)