Created
December 9, 2015 10:05
-
-
Save bjoerntx/a28c74a08511d7490d02 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
[HttpPost] | |
public bool SaveTemplate(DocumentViewModel model) | |
{ | |
string name = model.DocumentName; | |
byte[] document = Convert.FromBase64String(model.BinaryDocument); | |
using (TXTextControl.ServerTextControl tx = | |
new TXTextControl.ServerTextControl()) | |
{ | |
tx.Create(); | |
tx.Load(document, TXTextControl.BinaryStreamType.InternalUnicodeFormat); | |
tx.Save(Server.MapPath("/App_Data/documents/" + model.DocumentName), | |
TXTextControl.StreamType.WordprocessingML); | |
} | |
return true; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment