Esempio n. 1
0
        public IActionResult AddProfileImage(long userId, [FromForm(Name = "profileImage")] IFormFile imageFile)
        {
            if (imageFile != null)
            {
                using (var stream = new MemoryStream())
                {
                    imageFile.CopyTo(stream);
                    _userServices.AddProfileImage(userId, imageFile.FileName, stream.ToArray());
                }

                return(Ok());
            }

            return(BadRequest());
        }