Skip to content

Instantly share code, notes, and snippets.

@lapshinmr
Created August 23, 2017 10:41
Show Gist options
  • Select an option

  • Save lapshinmr/0547dd36c77898205238aef450f7ce4f to your computer and use it in GitHub Desktop.

Select an option

Save lapshinmr/0547dd36c77898205238aef450f7ce4f to your computer and use it in GitHub Desktop.
return send_file(BytesIO(open(z.filename, 'rb').read()),
attachment_filename=curdir_basename + '.zip',
as_attachment=True)
import zipfile
with zipfile.ZipFile(os.path.join(curdir, curdir_basename + '.zip'), 'w') as z:
for f_path in [a_path, w_path, q_path]:
z.write(f_path, os.path.basename(f_path))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment