WopiHost
WopiHost copied to clipboard
Does this mean OWA 2013 server wont support docx editing?
Sorry I didnt find any way to ask question except raising defect :(
OWA 2013 supports docx editing
Thanks for the response
Hi, I use this project and owa 2003, to open and edit office file I can open/edit exel, ppt, but only open word can't edit word Can you show me the problems?
Thank you
If you use owas 2013, you should use the code branch of release_0.8_for_owa2013. Branch master is match with oos 2016
Hi marx-yu, I've already got branch, and completely run with owa 2013 in your sample project, But I've got an error when use in my project web api I realize that the difference is when response data in post method I haven't found the solution yet So, I keep my problem in this issues thread, hope you can help me to find problems
Code in my project: private HttpResponseMessage GetFile(string id) { var editSession = GetSession(id);
//cobalt, for docx and pptx
var ms = new MemoryStream();
HttpContext.Current.Request.InputStream.CopyTo(ms);
AtomFromByteArray atomRequest = new AtomFromByteArray(ms.ToArray());
RequestBatch requestBatch = new RequestBatch();
Object ctx;
ProtocolVersion protocolVersion;
requestBatch.DeserializeInputFromProtocol(atomRequest, out ctx, out protocolVersion);
editSession.ExecuteRequestBatch(requestBatch);
foreach (Request request in requestBatch.Requests)
{
if (request.GetType() == typeof(PutChangesRequest) && request.PartitionId == FilePartitionId.Content)
{
//upload file to hdfs
editSession.Save();
}
}
var response = requestBatch.SerializeOutputToProtocol(protocolVersion);
var responseMessage = new HttpResponseMessage(HttpStatusCode.OK);
Stream stream = new MemoryStream();
response.CopyTo(stream);
responseMessage.Content = new StreamContent(stream);
responseMessage.Content.Headers.Add("X-WOPI-CorellationID", HttpContext.Current.Request.Headers["X-WOPI-CorrelationID"]);
responseMessage.Content.Headers.Add("request-id", HttpContext.Current.Request.Headers["X-WOPI-CorrelationID"]);
responseMessage.Content.Headers.ContentType = new MediaTypeHeaderValue("application/octet-stream");
responseMessage.Content.Headers.ContentLength = stream.Length;
return responseMessage;
}