Sending Zip file to Client via Response with DotNetZip

…衆ロ難τιáo~ 提交于 2019-12-05 19:07:44

hint:

don't use

HttpContext.Current.ApplicationInstance.CompleteRequest();    

instead, use

Response.Close();

If you use the former, you will get HTML junk appended to the bottom of your zip file.

Have you tried putting in the AddFile method with some dummy text = I think this is required.

The example you linked to on CodePlex seems to say the AddEntry method reads data from a stream. You're just passing in a string - maybe you could try creating a StringReader to look at your ReadmeText string, and pass this in instead?

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!