Esempio n. 1
0
        public IActionResult GetProfileImage(string profileImage)
        {
            if (!_fileManagementService.GetContentOfType(profileImage, DataType.Profile, out var imageBytes))
            {
                return(new NotFoundResult());
            }

            if (!new FileExtensionContentTypeProvider().TryGetContentType(profileImage, out var contentType))
            {
                contentType = "application/octet-stream";
            }

            return(new FileContentResult(imageBytes, contentType));
        }