Move downloads to new controller

This commit is contained in:
2020-07-21 22:02:55 -04:00
parent 6a18b1be58
commit 25b5d8ebc6
10 changed files with 126 additions and 104 deletions
+2 -16
View File
@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.Mvc;
using LeafWeb.Core.Entities;
@@ -71,20 +72,5 @@ namespace LeafWeb.WebCms.Controllers
select li;
return View(viewModel);
}
[ActionLog]
public ActionResult Download(string token)
{
var leafInput = DataService.GetLeafInput(token);
if (leafInput == null)
return View("DownloadNotFound");
var zip = leafInput.GetOutputFileZip(LeafOutputFileType.ToUser);
var filename = leafInput.Identifier.FilterValidFilename() + ".zip";
return new FileContentResult(zip, "application/zip") { FileDownloadName = filename };
}
}
}
}