Providing download feature of a file as stream with zip

I have been struggling this for few days and posted it on stackoverflow. Found some suggestions but still not found the answer to be able to solve the problem. I hope I am not violating the rules of forum by posting stackoverlfow link rather than ask my Q verbatim here.

Any help will be appreciated.