using Microsoft.AspNetCore.Mvc; using TCC.Services; namespace TCC.Controllers { [ApiController] [Route("image")] public class ImageController : ControllerBase { private ImageService ImageService { get; set; } public byte[] ImageData { get; set; } public ImageController(ImageService imageService) { this.ImageService = imageService; } [HttpPost("save-big-image")] public async Task SaveBigImage() { MemoryStream mstream = new MemoryStream(); await HttpContext.Request.Body.CopyToAsync(mstream); mstream.Position = 0; ImageService.SaveImage(mstream); mstream.Close(); return Ok(); } } }