Use the ZipArchive.CreateEntry method to add files from memory streams.
If you are developing a software feature involving ZIP archives, standard libraries provide specific methods: 155968 zip
Upload the ZIP archive to create a web-accessible hosted feature layer. Use the ZipArchive
The zipfile module allows you to write existing files into an output archive using zipfile.ZipFile(path, 'a').write(file) . 155968 zip