Add Zip download link

This commit is contained in:
2016-04-19 07:32:13 -04:00
parent 2cf5662461
commit 3f12f19b70
4 changed files with 36 additions and 0 deletions
+13
View File
@@ -1,6 +1,10 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Runtime.InteropServices.ComTypes;
using System.Web;
using System.Web.Mvc;
using LeafWeb.Core.Entities;
@@ -100,6 +104,15 @@ namespace LeafWeb.Web.Controllers
return View("Index", viewModel);
}
public FileContentResult DownloadResults(int d)
{
var leafInput = DataService.GetLeafInput(d);
var zip = leafInput.GetOutputFileZip();
return new FileContentResult(zip, "application/zip") {FileDownloadName = leafInput.Identifier + ".zip"};
}
private FileInfo[] GetBackloadDirectoryFiles(string directoryName)
{
var path = Path.Combine(Server.MapPath("~/Files/"), directoryName + "\\");