Exemple #1
0
        public FileResult Image(ImageViewDownload model)
        {
            string fileName = string.Empty;

            //model.itemValue;
            if (model == null || model.itemValue == null || model.itemValue == "" || model.itemValue == "undefined")
            {
                fileName = string.Empty;
            }
            else
            {
                try
                {
                    fileName = SymCryptoUtility.Decrypt(model.itemValue);
                }
                catch (Exception)
                {
                    fileName = model.itemValue;
                }
            }


            try//照片路径不存在报错(新老数据问题)
            {
                string mimeType = GetMimeMapping(fileName);
                Stream stream   = fileHander.LoadFile(string.Empty, fileName);
                return(new FileStreamResult(stream, mimeType));
            }
            catch (Exception)
            {
                return(null);
            }
        }
Exemple #2
0
        public ActionResult CommonReportByPath(string path)
        {
            string reportPath    = SymCryptoUtility.Decrypt(path);
            var    imageData     = reportService.GetPdfFromPkr(reportPath);
            var    imageFileName = "报告文件{0}-{1}.pdf".Fmt(DateTime.Now.ToString("yyyy-MM-dd"), DateTime.Now.Ticks);
            string contentType   = MimeMapping.GetMimeMapping(imageFileName);

            return(new FileContentResult(imageData, contentType));
        }
Exemple #3
0
        public ActionResult download(string filepath, string fileName)
        {
            var path = SymCryptoUtility.Decrypt(filepath);

            byte[] bytes    = System.IO.File.ReadAllBytes(path);
            string mimeType = MimeMapping.GetMimeMapping(fileName);

            return(File(bytes, mimeType));
        }
        public string GetClearReportNum(string cryptPkrReportNum)
        {
            var pkrReportNum = SymCryptoUtility.Decrypt(cryptPkrReportNum);

            return(pkrReportNum);
        }