with zipfile.ZipFile(memory_file, 'w') as zf:
    files = result['files']
for individualFile in files:
    data = zipfile.ZipInfo(individualFile['fileName'])
data.date_time = time.localtime(time.time())[:6]
data.compress_type = zipfile.ZIP_DEFLATED
zf.writestr(data, individualFile['fileData'])
memory_file.seek(0)
return send_file(memory_file, attachment_filename='capsule.zip',
    as_attachment=True)
How to send zip files in the python Flask framework?