コード例 #1
0
ファイル: LibraryController.cs プロジェクト: AuthorProxy/QP
        public JsonResult TestLibraryFileDownload(int id, string fileName, string entityTypeCode)
        {
            var pathInfo = entityTypeCode == EntityTypeCode.ContentFile ? ContentFolderService.GetPathInfo(id) : SiteFolderService.GetPathInfo(id);

            if (pathInfo == null)
            {
                var formatString = entityTypeCode == EntityTypeCode.ContentFile ? LibraryStrings.ContentFolderNotExists : LibraryStrings.SiteFolderNotExists;
                return(Json(new { proceed = false, msg = string.Format(formatString, id) }, JsonRequestBehavior.AllowGet));
            }

            return(GetTestFileDownloadResult(pathInfo, fileName, false));
        }
コード例 #2
0
ファイル: LibraryController.cs プロジェクト: AuthorProxy/QP
        public JsonResult GetLibraryImageProperties(int id, string fileName, string entityTypeCode)
        {
            var pathInfo = entityTypeCode == EntityTypeCode.ContentFile ? ContentFolderService.GetPathInfo(id) : SiteFolderService.GetPathInfo(id);

            return(GetFileProperties(pathInfo, fileName, new FilePropertiesOptions()));
        }