4

So in my action result, I return a file, which is downloaded.

return File(directory + @"\Issues.zip", "appicaltion/zip", "IssueReports.zip");

As well as that, I would like to refresh my page (This will get rid of some objects on the screen. I would usually do that with

return RedirectToAction("Index");

But I can't return two things at once, can I. So if anybody could help out, that'd be great.

Thanks (:

tereško
  • 58,060
  • 25
  • 98
  • 150
Oyyou
  • 610
  • 5
  • 13

1 Answers1

-1
var outputStream = new MemoryStream();

using (var zip = new ZipFile())
{
zip.AddEntry("file1.txt", "content1");
zip.AddEntry("file2.txt", "content2");
zip.Save(outputStream);
}

outputStream.Position = 0;
return File(outputStream, "application/zip", "filename.zip");
hs.chandra
  • 707
  • 1
  • 7
  • 19