News for hackers. Stuff that matters.
Re:Python – Writing large ZIP archives without memory inflation by m4rtink on Friday May 15, 2020 @10:33PM (#23199979)
Yeah, I looked into this a while ago forgenerating photo gallery zip files on the fly. Currently I'm using lazygal to generate static html galleries and if I want to give users the option to easoly download the full gallery, it basically doubles the size I need to store, as lazygal simply creates a zip file and puts it next to the photos and html files in the static gallery folder it generates.

So I looked to creating the zip files on the fly when requested & streaming them to the client onthe other end withou having to create temporary files and/or a lot of memmory consumption on the server. I got it working on a prototype and even found some articles from others that got it working - it is not that hard, really.

Re:Python – Writing large ZIP archives without memory inflation by kitotik on Friday May 15, 2020 @11:27PM (#23200249)
It was apparently hard enough that you had to build a prototype and consult other prior write ups.

When you really need something done it’s sometimes very helpful to be able quickly get it done.

Re:Python – Writing large ZIP archives without memory inflation by scosman on Saturday May 16, 2020 @01:09PM (#23205189)
I built exactly this once. Here it is as a microservice you can deploy to heroku in 1 click:

https://github.com/scosman/zipstreamer

Re:Python – Writing large ZIP archives without memory inflation by eggsnbacon1 on Saturday May 16, 2020 @04:01AM (#23201372)
its very easy to zip on the fly with C#, Java, JS. No idea why Python has this blind spot