Opening OS File Manager from a Web Page

To open OS file manager the WebDAV Ajax API provides OpenFolderInOsFileManager() function that opens default OS File Manager:

        function openFolder() {
            ITHit.WebDAV.Client.DocManager.OpenFolderInOsFileManager("http://server/folder/", "/", protocolInstallCallback);
        }
            
        function protocolInstallCallback(message) {
           var installerFilePath = "/Plugins/" + ITHit.WebDAV.Client.DocManager.GetProtocolInstallFileNames()[0];
            
           if (confirm("This action requires a protocol installation. Select OK to download the protocol installer.")){
               window.open(installerFilePath);
           }
        }

Depending on the web browser the  OpenFolderInOsFileManager() function will use:

  • Web Folders Behavior in case of Internet Explorer 10 and earlier.
  • davX: protocol in case of any other web browser.

The OpenFolderInOsFileManager() function accepts the following parameters:

  • Folder Url. Url of the WebDAV folder to be displayed in OS File Manager. This must be a full path including domain name.
  • Url to be mounted (optional). URL of the folder that will be mounted on your local file system. Usually, this is your WebDAV server root. In some cases, your WebDAV server root is not the same as your website root (for example your WebDAV may be located on http://webdavserver/mywebdavfolder/). In the case second parameter is omitted, the API will pick the folder in which the file is located. For example, if your file URL is http://webdavserver/folder/document.ext it will mount http://webdavserver/folder/ in your file system. As a result, if this parameter is not specified, you may find several folders mount in your local file system after opening documents located in different folders.
  • Error callback. A callback function that will be called if opening of the file manager failed. In this callback you will typically request a protocol installation and will redirect to the installer that targets client OS.

 

 

Opening Photoshop Files for Editing from a Web Page | Opening Office Documents in a LibreOffice for Editing from a Web Page | Opening AutoCAD Files from a Web Page for Editing | Opening PDF File in Adobe Acrobat for Editing from a Web Page

Next Article:

Re-branding Protocol Apps and Building from Source Code