I have the following code to create a downloadable zip archive that works fine:
ZipFile zip = new ZipFile();
zip.AlternateEncoding = Encoding.UTF8;
zip.AlternateEncodingUsage = ZipOption.Always;
zip.AddFiles(filePaths, false, ".");
string zipName = String.Format("Files_{0}.zip", DateTime.Now.ToString("yyyy-MMM-dd"));
Response.Clear();
Response.BufferOutput = false;
Response.ContentType = "application/zip";
Response.AddHeader("content-disposition", "attachment; filename=" + zipName);
zip.Save(Response.OutputStream);
Response.End();
users usually open files within a zip archive without extracting that. unfortunately I cannot open a file without extracting when using above code to create a zip archive. when trying to open a file an extra window appears shown as below:
I tried both two namespaces: Ionic.Zip and SharpCompress and the problem appears in either one. any help would be appreciated. tks