Skip to content

Instantly share code, notes, and snippets.

@bjoerntx
Created November 23, 2023 14:12
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/8d55eb9320b64db88cc8cb22344db6ba to your computer and use it in GitHub Desktop.
Save bjoerntx/8d55eb9320b64db88cc8cb22344db6ba to your computer and use it in GitHub Desktop.
private static readonly LiteDatabase db = new LiteDatabase(@"Filename=App_Data/documents.db; Connection=shared");
public static void AddTemplate(MemoryStream stream, string id = null, string name = "template.tx")
{
var templateId = id ?? "$/templates/" + Guid.NewGuid().ToString();
db.FileStorage.Upload(templateId, name, stream);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment