Opening webdav links with the correct program on the client

We have a browser based application that integrates the webdav server. We create URLs for certain documents on our surf (webdav). ( https://server.com/webdav/path/to/file.doc )

What we are looking for is a good way for our customers to open these links directly in the appropriate program. I.E. for a Windows user, " https://server.com/webdav/path/to/excelfile.xls " should open in MS Excel, while the same link should open OOCalc on Linux.

So far, we have used a small applet that has extensions, OS and programs and opens the program through Runtime.getRuntime().exec(..) . This approach works pretty well on Ms-Windows, but is problematic for Linux and Mac clients, and also quite inflexible.

Is there a better way to do this?

+4
source share
4 answers

Isn't that the one for which the tha java.awt.Desktop class was developed?

I say “Designed for,” because there are many things that it does not do well or right, but it works for some things. There is no “open with” option, for example, the operating system should ask you why you should open the document if nothing is registered there.

Can it interpret the URL as a web url, open a browser, and then the browser can delegate the opening of the file? in this case you have to load the document in a temporary file and then use desktop.open?

0
source

If you set the MIME file types to the appropriate format, all browsers should be able to handle them. Then the user can make a default decision for this type (open acrobat, word, excel, notepad) or select a custom one.

0
source

Unfortunately, the applet is the only solution at the moment. But in rare cases, we use the plugins "SharePoint.OpenDocuments" and 'application/x-sharepoint' . You can compare with your solution here .

0
source

Nowadays, it works great in Internet Explorer 10/11. But you will need to add a registry key to allow Office to open documents transmitted from the browser as read / write. The registry key is as follows:

Office 2013:

HKEY_CURRENT_USER \ Software \ Microsoft \ Office \ 15.0 \ Common \ Internet \ OpenDocumentsReadWriteWhileBrowsing = 0x1 (DWORD)

Office 2010:

HKEY_CURRENT_USER \ Software \ Microsoft \ Office \ 14.0 \ Common \ Internet \ OpenDocumentsReadWriteWhileBrowsing = 0x1 (DWORD)

For information on installing the key, see this article: http://social.technet.microsoft.com/Forums/office/en-US/06fedd90-4889-45ca-949d-60b76d74dd15/ms-word-open-document-readonly- with-webdav

0
source

All Articles