コード例 #1
0
        public FileContentResult ShowTemp(IContext context, string reference, string guid)
        {
            var log  = new SysLogModel(context: context);
            var file = BinaryUtilities.DownloadTemp(context: context, guid: guid);

            log.Finish(context: context, responseSize: file?.FileContents.Length ?? 0);
            return(file);
        }
コード例 #2
0
        public FileContentResult DownloadTemp(string reference, string guid)
        {
            var log  = new SysLogModel();
            var file = BinaryUtilities.DownloadTemp(guid);

            log.Finish(file?.FileContents.Length ?? 0);
            return(file);
        }
コード例 #3
0
        public ActionResult ShowTemp(string reference, string guid)
        {
            var log  = new SysLogModel();
            var file = BinaryUtilities.DownloadTemp(guid);

            log.Finish(file?.FileContents.Length ?? 0);
            return(file != null
                ? File(file.FileContents, file.ContentType)
                : null);
        }
コード例 #4
0
        public FileContentResult ShowTemp(Context context, string reference, string guid)
        {
            var log  = new SysLogModel(context: context);
            var file = BinaryUtilities.DownloadTemp(context: context, guid: guid);

            log.Finish(context: context, responseSize: file?.FileContents?.Length ?? 0);
            return(file != null
                ? new FileContentResult(System.Text.Encoding.UTF8.GetBytes(file.FileContents), file.ContentType)
                : null);
        }
コード例 #5
0
        public ActionResult ShowTemp(string reference, string guid)
        {
            var context = new Context();
            var log     = new SysLogModel(context: context);
            var file    = BinaryUtilities.DownloadTemp(context: context, guid: guid);

            log.Finish(context: context, responseSize: file?.FileContents.Length ?? 0);
            return(file != null
                ? File(file.FileContents, file.ContentType)
                : null);
        }
コード例 #6
0
        public ActionResult DownloadTemp(string reference, string guid)
        {
            var context = new Context();
            var log     = new SysLogModel(context: context);
            var file    = BinaryUtilities.DownloadTemp(context: context, guid: guid);

            if (file == null)
            {
                return(RedirectToAction("notfound", "errors"));
            }
            log.Finish(context: context, responseSize: file?.FileContents.Length ?? 0);
            return(file);
        }
コード例 #7
0
        public FileResult DownloadTemp(Context context, string reference, string guid)
        {
            var log  = new SysLogModel(context: context);
            var file = BinaryUtilities.DownloadTemp(context: context, guid: guid);

            log.Finish(context: context, responseSize: file?.FileContents?.Length ?? 0);
            return(file?.IsFileInfo() == true
                ? (FileResult) new FilePathResult(file?.FileInfo.FullName, file?.ContentType)
            {
                FileDownloadName = file?.FileDownloadName
            }
                : (FileResult) new FileStreamResult(file?.FileContentsStream, file?.ContentType)
            {
                FileDownloadName = file?.FileDownloadName
            });
        }