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 + "\\");
|
||||
|
||||
Reference in New Issue
Block a user