Question

I have integrated a WebDAV server into my website (using the product by IT Hit) to allow users to do "online editing" of Office documents without having to download and re-upload. It generally seems to work except for the first time a user tries to open a link, it is always read only. After they have opened any WebDAV link the first time, it seems to work fine after that. Looking at Fiddler, there are a different set of requests to open the file the first time compared to subsequent times.

First time (HTTP Method - URL - User Agent):

GET - Files/doc.docx - Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; WOW64;   Trident/6.0)
OPTIONS - Files/ - Microsoft Office Protocol Discovery
OPTIONS - Files/ - Microsoft Office Excel 2013
HEAD - Files/doc.docx - Microsoft Office Excel 2013
GET - Files/doc.docx - Microsoft Office Excel 2013
PROPFIND - Files/doc.docx - Microsoft Office Excel 2013

Subsequent times:

OPTIONS - Files/ - Microsoft Office Excel 2013
HEAD - Files/doc.docx - Microsoft Office Excel 2013
LOCK - Files/doc.docx - Microsoft Office Excel 2013
GET - Files/doc.docx - Microsoft Office Excel 2013
PROPFIND - Files/doc.docx - Microsoft Office Excel 2013

The browser treats the links differently when you click them in each case also. The first time, it opens the usual open/save as/cancel box but after that it gives you a Microsoft Office dialog asking if you want to open this file.

It does not seem to be just my implementation though, as the same behaviour happens when using this: http://ajaxbrowser.com/ (you need to be in IE).

I have tried intercepting the requests that are not going to work by checking the user agent but it seems that stops it working out how to open the links correctly in future.

Has anyone come across this before and found a way around it? It isn't great if the first time a user tries the new functionality, it doesn't work. It also isn't that obvious that it hasn't worked and I can easily see some users saving the read only file locally and expect that it has synced with the server. Any solution that would avoid that situation is welcome.

Was it helpful?

Solution

This turns out to be a bug relating to Office 2013. It seems to work fine for Office 2010.

I asked IT Hit to have a look at it and they found a work around if you open the link using the following javascript:

window.location('ms-word:ofe|u|' + documentLocation);

Where agent is ms-word can be replaced with ms-excel depending on the type of file.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top