Exemple #1
0
        public FileContentResult Show(Context context, string guid)
        {
            var log  = new SysLogModel(context: context);
            var file = BinaryUtilities.Donwload(context: context, guid: guid);

            log.Finish(context: context, responseSize: file?.FileContents.Length ?? 0);
            return(file);
        }
Exemple #2
0
        public FileContentResult Download(string reference, string guid)
        {
            var log  = new SysLogModel();
            var file = BinaryUtilities.Donwload(guid);

            log.Finish(file?.FileContents.Length ?? 0);
            return(file);
        }
Exemple #3
0
        public ActionResult Show(string reference, string guid)
        {
            var log  = new SysLogModel();
            var file = BinaryUtilities.Donwload(guid);

            log.Finish(file?.FileContents.Length ?? 0);
            return(file != null
                ? File(file.FileContents, file.ContentType)
                : null);
        }
        public ActionResult Show(string guid)
        {
            var context = new Context();
            var log     = new SysLogModel(context: context);
            var file    = BinaryUtilities.Donwload(context: context, guid: guid);

            log.Finish(context: context, responseSize: file?.FileContents.Length ?? 0);
            return(file != null
                ? File(file.FileContents, file.ContentType)
                : null);
        }
        public ActionResult Download(string guid)
        {
            var context = new Context();
            var log     = new SysLogModel(context: context);
            var file    = BinaryUtilities.Donwload(context: context, guid: guid);

            if (file == null)
            {
                return(RedirectToAction("notfound", "errors"));
            }
            log.Finish(context: context, responseSize: file?.FileContents.Length ?? 0);
            return(file);
        }
        public FileContentResult Show(Context context, string guid)
        {
            var log  = new SysLogModel(context: context);
            var file = BinaryUtilities.Donwload(
                context: context,
                guid: guid)
                       ?.FileStream();

            log.Finish(context: context, responseSize: file?.FileContents?.Length ?? 0);
            return(file != null
                ? new FileContentResult(file.FileContents, file.ContentType)
                : null);
        }
        public FileResult Download(Context context, string guid)
        {
            var log  = new SysLogModel(context: context);
            var file = BinaryUtilities.Donwload(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
            });
        }
        public ActionResult GetStream(Context context, string guid)
        {
            var log = new SysLogModel(context: context);

            if (!context.Authenticated)
            {
                return(ApiResults.Unauthorized(context: context));
            }
            var file = BinaryUtilities.Donwload(
                context: context,
                guid: guid.ToUpper());

            if (file == null)
            {
                return(ApiResults.NotFound(context: context));
            }
            var response = CreateFileSteramResult(file);

            log.Finish(
                context: context,
                responseSize: file?.Length ?? 0);
            return(response);
        }