Пример #1
0
        /// <summary>
        /// Loads a picture from file
        /// </summary>
        /// <param name="pictureId">Picture identifier</param>
        /// <param name="mimeType">MIME type</param>
        /// <returns>Picture binary</returns>
        protected virtual byte[] LoadPictureFromFile(int pictureId, string mimeType)
        {
            var lastPart = GetFileExtensionFromMimeType(mimeType);
            var fileName = $"{pictureId:0000000}_0.{lastPart}";
            var filePath = GetPictureLocalPath(fileName);

            return(_fileProvider.ReadAllBytes(filePath));
        }
Пример #2
0
        byte[] GetWorkFileContentOnDisk(WorkFile item)
        {
            var _fileStore = _fileProvider.Combine(_fileProvider.MapPath(GSDataSettingsDefaults.FolderWorkFiles), item.CreatedDate.ToPathFolderStore(), item.FileGuid.ToString() + item.Extension);

            return(_fileProvider.ReadAllBytes(_fileStore));
        }