public ActionResult CommonFileDownload(HttpFile fileModel) { try { HttpFile downFile = HttpFileRepository.SelFile(fileModel); if (downFile == null || downFile.FileOID == null) { throw new Exception("잘못된 호출입니다."); } System.IO.Stream fileStream = SemsValut.GetFileStream(downFile); //new ActionLog(downFile, eActionType.DOWNLOAD, null).InsertData(); if (Request.Browser.Browser == "IE" || Request.Browser.Browser == "InternetExplorer") { return(File(fileStream, MediaTypeNames.Application.Octet, HttpUtility.UrlEncode(downFile.OrgNm, System.Text.Encoding.UTF8))); } else { return(File(fileStream, MediaTypeNames.Application.Octet, downFile.OrgNm)); } } catch (Exception ex) { string message = ex.Message.Replace("'", ""); return(Content("<script language='javascript' type='text/javascript'>alert('" + message + "');history.back();</script>")); } }
public JsonResult GetFileList(HttpFile httpFile) { try { return(Json(HttpFileRepository.SelFiles(httpFile))); } catch (Exception ex) { return(Json(new ResultJsonModel { isError = true, resultMessage = ex.Message, resultDescription = ex.ToString() })); } }