Add Zip download link
This commit is contained in:
@@ -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 + "\\");
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
<package id="NLog.Config" version="4.2.3" targetFramework="net45" />
|
||||
<package id="NLog.Schema" version="4.0.0" targetFramework="net45" />
|
||||
<package id="Owin" version="1.0" targetFramework="net45" />
|
||||
<package id="Polly" version="4.2.0" targetFramework="net45" />
|
||||
<package id="Twitter.Bootstrap.Less" version="3.3.6" targetFramework="net45" />
|
||||
<package id="WebGrease" version="1.6.0" targetFramework="net45" />
|
||||
</packages>
|
||||
Reference in New Issue
Block a user