init
This commit is contained in:
commit
e124a47765
19374 changed files with 9806149 additions and 0 deletions
26
KretaWeb/Controllers/CacheController.cs
Normal file
26
KretaWeb/Controllers/CacheController.cs
Normal file
|
@ -0,0 +1,26 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
using System.Web.Mvc;
|
||||
using Kreta.Core;
|
||||
|
||||
namespace Kreta.Web.Controllers
|
||||
{
|
||||
[AllowAnonymous]
|
||||
public class CacheController : Controller
|
||||
{
|
||||
/// <summary>
|
||||
/// Wraps the stored MemoryStream into an Excel file.
|
||||
/// </summary>
|
||||
/// <param name="guid">Unique identifier of the file.</param>
|
||||
/// <param name="fileName">File download name.</param>
|
||||
/// <param name="contentType">Content type of the returned FileStream.</param>
|
||||
/// <returns>The requested file as a FileStreamResult.</returns>
|
||||
[HttpGet]
|
||||
public ActionResult DownloadFile(Guid guid, string fileName, string contentType)
|
||||
{
|
||||
var stream = Cache.Get(guid) as MemoryStream;
|
||||
|
||||
return new FileStreamResult(stream, contentType) { FileDownloadName = fileName };
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue