fringd / zipline

A gem that lets you stream a zip file from rails

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is it possible to use zipline and serve file contents directly, rather than using URLs?

fatuhoku opened this issue · comments

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?

have you tried [new StringIO(file_contents), zip_path]

i think that should work

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...

hopefully that helped. closing this issue for now. please re-open if you are still having trouble.

@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.