[Fixed]-Create zip file from in memory file in python

1👍

Try to use writestr

Signature: writestr(zinfo_or_arcname, data, compress_type=None)

Docstring: Write a file into the archive. The contents is ‘data’,
which may be either a ‘str’ or a ‘bytes’ instance; if it is a ‘str’,
it is encoded as UTF-8 first. ‘zinfo_or_arcname’ is either a ZipInfo
instance or the name of the file in the archive.

Leave a comment