File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55[ ![ Coverage Status] ( https://coveralls.io/repos/allanlei/python-zipstream/badge.png )] ( https://coveralls.io/r/allanlei/python-zipstream )
66
77zipstream.py is a zip archive generator based on python 3.3's zipfile.py. It was created to
8- generate a zip file generator for streaming (ie web apps). This is beneficial for when you
8+ generate a zip file generator for streaming (ie web apps). This is beneficial for when you
99want to provide a downloadable archive of a large collection of regular files, which would be infeasible to
1010generate the archive prior to downloading or of a very large file that you do not want to store entirely on disk or on memory.
1111
@@ -127,7 +127,7 @@ def zipball(request):
127127 z = zipstream.ZipFile(mode = ' w' , compression = ZIP_DEFLATED )
128128 z.write(' /path/to/file' )
129129
130- response = StreamingHttpResponse(z, mimetype = ' application/zip' )
130+ response = StreamingHttpResponse(z, content_type = ' application/zip' )
131131 response[' Content-Disposition' ] = ' attachment; filename={} ' .format(' files.zip' )
132132 return response
133133```
@@ -145,7 +145,7 @@ def GET(self):
145145```
146146
147147## Running tests
148-
148+
149149With python version > 2.6, just run the following command: ` python -m unittest discover `
150150
151151Alternatively, you can use ` nose ` .
You can’t perform that action at this time.
0 commit comments