some scretches about file upload

This commit is contained in:
2022-11-02 01:45:42 +10:00
parent 7737725327
commit b9d7f50cc9
5 changed files with 26 additions and 11 deletions

View File

@@ -0,0 +1,19 @@
using Microsoft.AspNetCore.Mvc;
using System.Net.Http.Headers;
using System.Text.Json;
namespace NeDvachAPI.Controllers
{
[ApiController]
[Route("[controller]")]
public class UploadPic : ControllerBase
{
[HttpPost(Name = "UploadPicture")]
public JsonResult ReceivePost([FromForm] IFormFile PostPicture)
{
Console.Write("Принята картинка ");
Console.WriteLine(PostPicture.FileName);
return new JsonResult(PostPicture.FileName + " получен!");
}
}
}