import multipart as mp
from multipart import to_bytes
try:
from io import BytesIO
except ImportError:
from StringIO import StringIO as BytesIO
@app.get(‘/‘, methods=["GET","POST"])
def index():
data = request.body
p = mp.MultipartParser(BytesIO(to_bytes(data)),s)
blob = p.parts()[0].value
f = open("file.bin","wb")
f.write(blob.encode("latin-1"))
f.close()
The current way to achieve this
Add support for form data built in!