using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using System.IO; using Sleis.Service; using Sleis.Utility; namespace Sleis.Controllers { public class ExportController : BaseController { public ExportService ExportService { get; set; } // GET: /DownloadExport/ [HttpGet, Authorize] public FileStreamResult DownloadExport(string exportName, int reportId=0, int facilityId=0) { MemoryStream zipStream = new MemoryStream(); ExportService.GenerateCsvExportToZip(exportName, reportId, facilityId, zipStream); zipStream.Position = 0;//reset position return File(zipStream, "application/octet-stream", String.Format("{0}.zip", exportName)); } } }