How do I generate and send a .zip file to a user in C# ASP.NET?

后端 未结 7 1044
感动是毒
感动是毒 2020-12-05 11:30

I need to construct and send a zip to a user.

I\'ve seen examples doing one or the other, but not both, and am curious if there are any \'best practices\' or anythin

7条回答
  •  有刺的猬
    2020-12-05 12:09

    Agree with above, SharpZipLib , for creating .zip files in .NET, it seems a very popular option.

    As for 'send'ing, if you mean via SMTP/Email, you will need to use the System.Net.Mail name space. The System.Net.Mail.Attachment Class documentation has an example of how to send a file via email

    Scratch the above, by the time I posted this I see you meant return via HTTP Response.

提交回复
热议问题