Skip to content

Instantly share code, notes, and snippets.

@bjoerntx
Created March 21, 2024 13:34
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/3b2dc31272b3deeaba2d62aa6e62f647 to your computer and use it in GitHub Desktop.
Save bjoerntx/3b2dc31272b3deeaba2d62aa6e62f647 to your computer and use it in GitHub Desktop.
[HttpGet]
[Route("Load")]
public DocumentData Load(string name)
{
// load the file from App_Data
var file = Path.Combine("App_Data", name);
var data = new DocumentData
{
Name = name,
Data = Convert.ToBase64String(System.IO.File.ReadAllBytes(file)),
};
return data;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment