[Chicago] django streaming zip

Chris Sinchok chris at sinchok.com
Wed Nov 11 10:34:15 EST 2015


A couple thoughts on this:

1. You could use the `zipfile` module to create a temporary file, and then
stream that, deleting it once the streaming is done.
2. You could try something like this, which appears to do almost exactly
what you want: https://github.com/allanlei/python-zipstream (I've
personally never tried this package before, though)

- Chris

On Wed, Nov 11, 2015 at 3:11 AM, Carl Karsten <carl at personnelware.com>
wrote:

> I have a django app and nginx serving up static files.
>
> I want the user to be able to get a set of files.  it will be 5 to 10
> files, most of them will be 5-10 meg, so about 50-100 meg total.
>
> The thought is provide a zip link, click the link, get a zip file.
>
> I am trying to avoid creating zip files on the local fs, either ahead of
> time or on the fly.  I am hoping I can pass something a list of file names
> and it will return the a file like object that I can pass on to whatever
> and the client will get is zip file as the server creates it.
>
> btw, it is a cut list (xml of file names and cut points) 2 png, 2-10 .webm
> files.
>
>
>
>
> --
> Carl K
>
>
> _______________________________________________
> Chicago mailing list
> Chicago at python.org
> https://mail.python.org/mailman/listinfo/chicago
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/chicago/attachments/20151111/ced5886f/attachment.html>


More information about the Chicago mailing list