Пример #1
0
        public async Task <IActionResult> Upload(string userId, [FromForm] UserForEditDto userForEditDto)
        {
            try
            {
                var imageUrl = _azureBlobStorageService.UploadFileToBlob(userForEditDto.File);
                var result   = await _userService.SetProfileImageUrl(userId, imageUrl);

                if (result == false)
                {
                    return(BadRequest("Failed save the image"));
                }
                Console.WriteLine($"path message: {imageUrl}");
                return(Ok());
            }
            catch (Exception ex)
            {
                return(StatusCode(500, $"Internal server error: {ex}"));
            }
        }