public virtual ActionResult DownloadFile(string sFileFullPath) { byte[] oFileToDownload = null; FileAccessService oFileAccessService = new FileAccessService(CommonHelper.sGetConfigKeyValue(ConstantNames.FileAccessURL)); try { oFileToDownload = oFileAccessService.ReadFile(sFileFullPath); } catch (Exception) { } return File(oFileToDownload, "application/force-download", System.IO.Path.GetFileName(sFileFullPath)); }
public ActionResult ReadExternal(string id, int v) { try { string filename; byte[] file = FileAccessService.ReadFile(id, v, out filename); return(File(file, System.Net.Mime.MediaTypeNames.Application.Octet, filename)); } catch (Exception ex) { return(RedirectToAction("Index", "Response", new { Message = "Access Denied", Code = 400, Type = "Error" })); } }
public virtual ActionResult DownloadFile(int nTicketID, string sFileName) { byte[] oFileToDownload = null; FileAccessService oFileAccessService = new FileAccessService(CommonHelper.sGetConfigKeyValue(ConstantNames.FileAccessURL)); try { string sFileFullPath = Path.Combine(this.CurrentApplicationID.ToString(), nTicketID.ToString(), sFileName); oFileToDownload = oFileAccessService.ReadFile(sFileFullPath); } catch (Exception ex) { } return(File(oFileToDownload, "application/force-download", sFileName)); }