Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does this mean OWA 2013 server wont support docx editing? #3

Open
joymon opened this issue Apr 28, 2016 · 5 comments
Open

Does this mean OWA 2013 server wont support docx editing? #3

joymon opened this issue Apr 28, 2016 · 5 comments

Comments

@joymon
Copy link

joymon commented Apr 28, 2016

Sorry I didnt find any way to ask question except raising defect :(

@petrsvihlik
Copy link

OWA 2013 supports docx editing

@joymon
Copy link
Author

joymon commented Jun 19, 2016

Thanks for the response

@huanbd
Copy link

huanbd commented Dec 29, 2016

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

@marx-yu
Copy link
Owner

marx-yu commented Dec 30, 2016

If you use owas 2013, you should use the code branch of release_0.8_for_owa2013. Branch master is match with oos 2016

@huanbd
Copy link

huanbd commented Dec 31, 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;
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants