/// <summary> /// GetArchiveBase64. /// </summary> /// <param name="archiveId"></param> /// <returns></returns> public async Task <ArchiveBase64ViewModel> GetArchiveBase64(String archiveId) { ArchiveBase64ViewModel result = null; ArchiveModel archive = (await _archiveRepository.FindOneArchive(archiveId)); String extension = MimeTypeMap.GetExtension(archive?.ContentType); String archivePath = String.Format(ConstantsConfiguration.PATH_IMAGES, archiveId, extension); if (!(File.ReadAllBytes(archivePath) is null) && (!(archive is null))) { result = new ArchiveBase64ViewModel(archive.ArchiveName, archive.ContentType, archivePath); } return(result); }