The controller HttpPost method accepts the JSON string in form of a model in the parameter. The document is converted to a byte array and loaded into a temporary ServerTextControl instance. Finally, the document is saved server-side using the Save method of the ServerTextControl object.
The model DocumentViewModel is shown in the code below:
Download the sample from GitHub and test it on your own.