opening a word document for editing with webdav RRS feed

  • Question

  • User780520453 posted


    I'm not sure if this is the correct place for this question..

    I am attempting to open a word document which resides in a webdav folder from my ASP.NET web app. I need IE to start word and open the original document from the webdav folder and allow the user to make changes to the document and save it back to the webserver.

    I've got it to open the document but it seemed to have copied the document to my temporary internet files folder and opened the copy from there. The original file name is "test.doc" but the opened temprary file is "test[1].doc" and so on. How can I get it to open the original document for editing?

    Can anyone see what I'm doing wrong here...

    string webDavVirtualDir = "/WebDav/test.doc";
    String fileP = Server.MapPath(url);
    System.IO.FileInfo file = new System.IO.FileInfo(fileP);
    Response.AddHeader("Content-Disposition", "attachment; filename=" + file.Name);
    Response.AddHeader("Content-Length", file.Length.ToString());
    Response.ContentType = "application/msword";

    I can open the same document from IE (via a web folder) and this works correctly by opening the file on the IIS server.

    Any help would be appreciated..




    Friday, September 29, 2006 2:01 AM

All replies

  • User-823196590 posted
    I think the problem in this case is that the browser is not actually interacting with the WebDAV folder. Why do you need to use this method to serve the file?
    Friday, September 29, 2006 8:22 AM
  • User-409947244 posted

    It's a complex intranet application. For this part of the project, we have RTF files that are stored on the server. A web service substitutes customer-specific data into these RTF files and then saves the document in a webdav directory. The document is then opened "locally" for any final editing/markup by the user. Once the user is happy, a File > Save saves the document back to the server.

    We want to use webdav if possible so that we don't have to write any Office Add-Ins to interface directly to our system.

    David (for Chamindu)

    Monday, October 2, 2006 6:14 PM
  • User-823196590 posted
    I there any way you can just create a direct URL link for the browser to open instead of writing the contents of the file to the browser?
    Tuesday, October 3, 2006 8:49 AM
  • User-409947244 posted

    Thanks again for your help Tom - it's much appreciated.

    Our first approach was using javascript eg. window.open("http://server/dav/doc.doc"). IE opened the document, the URL in the title bar was correct, however the Save menu option remains permanently disabled. Our only choice is to save locally. Using this method it seems that IE just doesn't realise that the file is opened from a dav folder and the document is treated just like any other file you download from the web.

    You can "sort of" get it to work from IE if you do a File > Open and check the "Open as Web Folder" box. This gives us a directory of files. Choosing a file brings it up in IE and we can save to the dav directory. Not quite the seamless solution we're hoping to achieve.


    Wednesday, October 4, 2006 1:05 AM
  • User-823196590 posted
    What if you just give the user an HTTP URL link to the document to click on?
    Wednesday, October 4, 2006 9:00 AM
  • User-409947244 posted

    Tried something like <a href="http://server/webdav/doc.doc">Click Me</a> but it produces the same "save locally" behaviour. Unfortunately the Save menu remains disabled.

    So far, the only way we've got it to work the way we want is via some js to create the ActiveX Word component and set the document properties. That works exactly the way we want, but feels more like a workaround than a solution.

    Wednesday, October 4, 2006 7:17 PM
  • User-823196590 posted

    AFAIK, that should work.

    Do you think this applies?

    Thursday, October 5, 2006 8:46 AM
  • User-1076464264 posted

    Did You find solution?


    We have the same problem, on Windows Xp/Server doesn't matter, we could not use Plugin for word or activex.

    Monday, August 25, 2008 7:34 AM