Further to the comment, I think the code which handles your upload is relevant here.
See this answer regarding request.data
:
request.data
Contains the incoming request data as string in case it came with a mimetype Flask does not handle.
The recommended way to handle file uploads in flask is to use:
file = request.files['file']
-
file
is then of type:werkzeug.datastructures.FileStorage
. -
file.stream
is the stream, which can be read withfile.stream.read()
or simplyfile.read()
-
file.filename
is the filename as specified on the client. -
file.save(path)
a method which saves the file to disk.path
should be a string like'/some/location/file.ext'