Zip created by using DotNetZip does not open using window extract all or double click, but it unzipped with 7 zip.
We converted DataTable to Csv by using an extension method, Added csv to a zip.
Please suggest if something is missing in the code,
Thanks
We converted DataTable to Csv by using an extension method, Added csv to a zip.
string TestCsv = extensionMethods1.ToCsv(TestDataTable);
string archiveName = String.Format("TestInfo-{0}.zip", DateTime.Now.ToString("yyyy- MM-dd-HHmmss"));
Response.ContentType = "application/zip";
Response.AddHeader("content-disposition", "filename=" + archiveName);
using (ZipFile TestZip = new ZipFile())
{
TestZip.AddEntry("test1.csv", TestCsv);
TestZip.Save(Response.OutputStream);
}
Response.Flush();
Response.Clear();
The downloaded zip extracted successfully using 7 zip but does not open using windows Extract All or by double clicking.Please suggest if something is missing in the code,
Thanks