Hey,
I have working project that gets a doc and convert it to HTML in .net and iam trying to migrate my project to .net core.
My code .net core code:
[HttpPost, Route("api/docToHtml")]
public JObject DocToHtml(List<IFormFile> files)
{
using (var postFIle = new MemoryStream())
{
files[0].CopyTo(postFile);
Document doc = new Document(postFile);
}
}
When iam calling new Document(postFIle) on any doc file Iam getting the exception:
Aspose.Words.FileCorruptedException ‘The document appears to be corrupted and cannot be loaded’.
Inner Exception
NullReferenceException: Object reference not set to an instance of an object