Flask: Get gzip filename sent from Postman

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 with file.stream.read() or simply file.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'

source

Leave a Comment