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

后端 未结 7 1088
感动是毒
感动是毒 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:27

    I'm sure others will recommend SharpZipLib

    How do you intend to "send" it. .NET has built in Libraries for email via SMTP

    EDIT

    In that case you'll want to capture the output stream from SharpZipLib and write it directly to the Response. Just make sure you have the correct Mimetype set in the Response Headers (application/zip) and make sure you don't Response.Write anything else to the user.

提交回复
热议问题