Created
March 20, 2024 09:19
-
-
Save bjoerntx/4864824928939e4ebc3e88a3ead79d1e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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