0

I am working on a website using asp.net 5 mvc and i want to create a zip file and return it as a single file so that user can download multiple file simultaneously. I try to find this on internet and get this code:

using (var zip = new ZipFile())
{
 zip.AddEntry("filename",content);
 }

But this code is not working in my project,, because ZipFile() class is static and there is not method like AddEntry() in it.

Kalp
  • 1,284
  • 2
  • 8
  • 16
  • 1
    If you find some code somewhere, it helps to read the text surrounding it. The code sample you found is for the library named DotNetZip, which you need to add to your project. – CodeCaster Apr 09 '16 at 09:59

2 Answers2

1

You probably want System.IO.Compression.ZipArchive and .CreateEntry, assuming that's the same in ASP.NET 5 as it is in .NET Framework.

yaakov
  • 5,552
  • 35
  • 48
0

if you want to add multiple file to zip i suppose this DotNetZip will help you. original link all you need is to use Server.MapPath(stringAddress) to locate you files in host

download the library and add .dll file/s to your project
cheers

Community
  • 1
  • 1
M.Armoun
  • 1,075
  • 3
  • 12
  • 38