Hi,
I'm using uploadcontroller in my application with i can upload well.
I'm trying to implement a method that upload a file to return it in xml file like this.
[HttpPost("uploadxml")]
public IActionResult SingleUploadXML(IFormFile file)
{
try
{
string path = string.Empty;
string filename = string.Empty;
// Put your code here
XmlDocument up = new XmlDocument();
if (file.Length > 0)
{
using (MemoryStream ms = new MemoryStream())
{
file.CopyToAsync(ms, CancellationToken.None);
ms.Position = 0;
up.Load(ms);
}
}
return Ok(new { importFile = up });
}
catch (Exception ex)
{
return StatusCode(500, ex.Message);
}
}
But in the UploadComplete method i can't get the content of file.
Could you support me, please ?