Is it possible to use zipline and serve file contents directly, rather than using URLs?
fatuhoku opened this issue · comments
Hok Shun Poon commented
e.g. instead of doing
zipline( files, 'avatars.zip') # 'files' looks like [url, zip_path]
as it says in https://github.com/fringd/zipline#usage, is it possible to do
zipline( file_contents, 'avatars.zip') # 'files' looks like [file_contents, zip_path]
and ... is it possible to mix using URLs with using file contents?
Ram Dobson commented
have you tried [new StringIO(file_contents), zip_path]
i think that should work
Ram Dobson commented
note that this won't give you the nice streaming that you want, but might be reasonable if all or some of your data is just sitting on your server...
Ram Dobson commented
hopefully that helped. closing this issue for now. please re-open if you are still having trouble.
Hok Shun Poon commented
@fringd requirements have changed and I did manage to get the nice streaming working 👍
Thanks for your help anyway might come in handy in the future.