Skip to content

Instantly share code, notes, and snippets.

@bjoerntx
Created July 22, 2019 14:20
Show Gist options
  • Save bjoerntx/1f364c548b1ad1444c1ffbe4f7bd1f3e to your computer and use it in GitHub Desktop.
Save bjoerntx/1f364c548b1ad1444c1ffbe4f7bd1f3e to your computer and use it in GitHub Desktop.
[System.Web.Http.HttpGet]
public HttpResponseMessage LoadDocument(string ConnectionID, string DocumentName)
{
// connect the WebSocketHandler with the ConnectionID
WebSocketHandler wsHandler = WebSocketHandler.GetInstance(ConnectionID);
// the document directly server-side
wsHandler.LoadText(System.Web.Hosting.HostingEnvironment.MapPath("~/App_Data/" + DocumentName),
StreamType.WordprocessingML);
return new HttpResponseMessage()
{
StatusCode = HttpStatusCode.OK
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment