using (MemoryStream megaStream = new MemoryStream())
{
using (ZipArchive zip = new ZipArchive(megaStream, ZipArchiveMode.Create, true))
{
foreach (HttpPostedFileBase upload in uploads)
{
ZipArchiveEntry entry = zip.CreateEntry(upload.FileName, CompressionLevel.Fastest);
using (Stream stream = entry.Open())
{
upload.InputStream.CopyTo(stream);
}
}
}
/*
Response.Buffer = true;
Response.Clear();
Response.ContentType = "application/zip";
Response.AddHeader("content-disposition", "attachment; filename=Test.zip");
Response.BinaryWrite(megaStream.ToArray());
Response.Flush();
*/
INode upload = await client.UploadAsync(megaStream, "Test.zip", pasta, new Progress<double>());
}