I want send email with attachement from file upload without saving attachement on application folder
I write a service that works well with file in application folder but i do not want save the file uploaded
I use simple api post with axios It pass well message and file name to controller
[HttpPost]
public async Task<IActionResult> SendMail([FromForm] EmailModel model)
{
...my service.SendMail(...);
}
public class EmailModel
{
public string Message { get; set; }
public string Attachement { get; set; }
}
let bodyFormData = new FormData();
bodyFormData.set('message',this.message);
bodyFormData.set('attachement',this.attachement);
axios({method:'post',url:"api/contact",data:bodyFormData,headers:{'Content-Type': 'multipart/form-data' }})
I read i should use IFormFile but if i try i get always both parameters null
Im blocked in this simple question
Please not send link to read
i read a tons and no one help