Add download input link
This commit is contained in:
@@ -28,6 +28,11 @@ namespace LeafWeb.Web.Controllers
|
||||
return View(viewModel);
|
||||
}
|
||||
|
||||
public ActionResult DownloadInput(int id)
|
||||
{
|
||||
return GetInputZip(id);
|
||||
}
|
||||
|
||||
public ActionResult DownloadOutputToUser(int id)
|
||||
{
|
||||
return GetOutputZip(id, LeafOutputFileType.ToUser);
|
||||
@@ -57,6 +62,20 @@ namespace LeafWeb.Web.Controllers
|
||||
return new FileContentResult(zip, "application/zip") { FileDownloadName = filename };
|
||||
}
|
||||
|
||||
private ActionResult GetInputZip(int id)
|
||||
{
|
||||
var leafInput = DataService.GetLeafInput(id);
|
||||
|
||||
if (leafInput == null)
|
||||
return View("DownloadNotFound");
|
||||
|
||||
var zip = leafInput.GetInputFileZip();
|
||||
|
||||
var filename = $"{leafInput.Identifier.FilterValidFilename()}_Input.zip";
|
||||
|
||||
return new FileContentResult(zip, "application/zip") { FileDownloadName = filename };
|
||||
}
|
||||
|
||||
public ActionResult Delete(int id)
|
||||
{
|
||||
var leafInput = DataService.GetLeafInput(id);
|
||||
|
||||
Reference in New Issue
Block a user