I have been able to download a zipfile before but then the compression happend on the ASP server. Now we have changed this action to another server (Progress).
At this moment I'm receiving a base64 encoded string which represents a zip file. But how can I convert this string to a zipfile. The code I used before you can find beneath, can I reuse code?
MemoryStream outputStream = new MemoryStream();
outputStream.Seek(0, SeekOrigin.Begin);
using (ZipFile zip = new ZipFile())
{
foreach (string id in idArray)
{
string json = rest.getDocumentInvoice(Convert.ToInt32(id));
byte[] file = json.convertJsonToFile();
zip.AddEntry("invoice" + id + ".pdf", file);
}
zip.Save(outputStream);
}
outputStream.WriteTo(Response.OutputStream);
Response.AppendHeader("content-disposition", "attachment; filename=invoices.zip");
Response.ContentType = "application/zip";
return new FileStreamResult(outputStream, "application/zip");
I have no idea how to convert a string to a zip file. Thanks in advance for your help