Skip to content

Instantly share code, notes, and snippets.

@bjoerntx
Last active June 8, 2020 14:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bjoerntx/12ed1ff7cd91536ba6a2e02acaad36a6 to your computer and use it in GitHub Desktop.
Save bjoerntx/12ed1ff7cd91536ba6a2e02acaad36a6 to your computer and use it in GitHub Desktop.
[Route("api/[controller]")]
[ApiController]
public class ViewerController : ControllerBase
{
[HttpGet]
[Route("LoadDocument")]
public LoadedDocument LoadDocument()
{
string documentName = "invoice.docx";
LoadedDocument document = new LoadedDocument()
{
DocumentData = Convert.ToBase64String(
System.IO.File.ReadAllBytes("App_Data/" + documentName)),
DocumentName = documentName
};
return document;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment