Skip to content

Instantly share code, notes, and snippets.

@bjoerntx
Created March 20, 2024 09:19
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/4864824928939e4ebc3e88a3ead79d1e to your computer and use it in GitHub Desktop.
Save bjoerntx/4864824928939e4ebc3e88a3ead79d1e to your computer and use it in GitHub Desktop.
[HttpGet]
[Route("Load")]
public DocumentData Load()
{
// open file as byte and convert to base64
byte[] fileBytes = System.IO.File.ReadAllBytes("App_Data/document.tx");
string file = Convert.ToBase64String(fileBytes);
return new DocumentData { Name = "document.pdf", Document = file };
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment