fringd / zipline

A gem that lets you stream a zip file from rails
MIT License
289 stars 68 forks source link

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

Closed fatuhoku closed 7 years ago

fatuhoku commented 7 years ago

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?

fringd commented 7 years ago

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

i think that should work

fringd commented 7 years ago

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

fringd commented 7 years ago

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

fatuhoku commented 7 years ago

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