Creating Zip file from stream and downloading it

前端 未结 8 1122
深忆病人
深忆病人 2020-12-02 22:20

I have a DataTable that i want to convert it to xml and then zip it, using DotNetZip. finally user can download it via Asp.Net webpage. My code in below

            


        
8条回答
  •  被撕碎了的回忆
    2020-12-02 22:57

    Double check the stream you are returning back too. In your example below

    zipFile.Save(Response.OutputStream);
    Response.Write(zipstream);
    zipFile.Dispose();
    

    You are saving the zipFile to your response stream using the Save method, but then you are also calling Response.Write() with a zipstream variable. What is zipstream? Check that it isn't an empty stream too.

提交回复
热议问题