WebDAV Authoring <authoring>

Overview

The <authoring> element specifies the site-level settings for WebDAV. The most important of these settings is whether WebDAV authoring is enabled for the site. Additional elements define the behavior for the WebDAV module, such as compatibility options and how the WebDAV module works with properties, locks, and the underlying file system.

Compatibility

Version Notes
IIS 10.0 The <authoring> element was not modified in IIS 10.0.
IIS 8.5 The <authoring> element was not modified in IIS 8.5.
IIS 8.0 The <authoring> element was not modified in IIS 8.0.
IIS 7.5 The <authoring> element ships as a feature of IIS 7.5.
IIS 7.0 The <authoring> element was introduced in WebDAV 7.0, which was a separate download for IIS 7.0.
IIS 6.0 N/A

Note

The WebDAV 7.0 and WebDAV 7.5 modules shipped out-of-band for IIS 7.0, which required downloading and installing the modules from the following URL:

https://www.iis.net/expand/WebDAV

With Windows 7 and Windows Server 2008 R2, the WebDAV 7.5 module ships as a feature for IIS 7.5, so downloading WebDAV is no longer necessary.

Setup

To support WebDAV publishing for your Web server, you must install the WebDAV module. To do so, use the following steps.

Windows Server 2012 or Windows Server 2012 R2

  1. On the taskbar, click Server Manager.
  2. In Server Manager, click the Manage menu, and then click Add Roles and Features.
  3. In the Add Roles and Features wizard, click Next. Select the installation type and click Next. Select the destination server and click Next.
  4. On the Server Roles page, expand Web Server (IIS), expand Web Server, expand Common HTTP Features, and then select WebDAV Publishing. Click Next.
    Image of Web Server and Common H T T P Features pane expanded with Web DAV Publishing selected.
  5. On the Select features page, click Next.
  6. On the Confirm installation selections page, click Install.
  7. On the Results page, click Close.

Windows 8 or Windows 8.1

  1. On the Start screen, move the pointer all the way to the lower left corner, right-click the Start button, and then click Control Panel.
  2. In Control Panel, click Programs and Features, and then click Turn Windows features on or off.
  3. Expand Internet Information Services, expand World Wide Web Services, expand Common HTTP Features, and then select WebDAV Publishing.
    Image of Common H T T P Features pane in Turn Windows features on or off page expanded with Web DAV Publishing selected.
  4. Click OK.
  5. Click Close.

Windows Server 2008 R2

  1. On the taskbar, click Start, point to Administrative Tools, and then click Server Manager.
  2. In the Server Manager hierarchy pane, expand Roles, and then click Web Server (IIS).
  3. In the Web Server (IIS) pane, scroll to the Role Services section, and then click Add Role Services.
  4. On the Select Role Services page of the Add Role Services Wizard, expand Common HTTP Features, select WebDAV Publishing, and then click Next.
    Screenshot of Common H T T P Features node in Select Role Services page expanded with Web DAV Publishing selected.
  5. On the Confirm Installation Selections page, click Install.
  6. On the Results page, click Close.

Windows 7

  1. On the taskbar, click Start, and then click Control Panel.
  2. In Control Panel, click Programs and Features, and then click Turn Windows Features on or off.
  3. Expand Internet Information Services, then World Wide Web Services, and then Common HTTP Features.
  4. Select WebDAV Publishing, and then click OK.
    Image of World Wide Web Services and Common H T T P Features pane expanded on Turn Windows features on or off page with Web DAV Publishing selected.

Windows Server 2008 or Windows Vista

How To

How to enable WebDAV publishing

  1. Open Internet Information Services (IIS) Manager:

    • If you are using Windows Server 2012 or Windows Server 2012 R2:

      • On the taskbar, click Server Manager, click Tools, and then click Internet Information Services (IIS) Manager.
    • If you are using Windows 8 or Windows 8.1:

      • Hold down the Windows key, press the letter X, and then click Control Panel.
      • Click Administrative Tools, and then double-click Internet Information Services (IIS) Manager.
    • If you are using Windows Server 2008 or Windows Server 2008 R2:

      • On the taskbar, click Start, point to Administrative Tools, and then click Internet Information Services (IIS) Manager.
    • If you are using Windows Vista or Windows 7:

      • On the taskbar, click Start, and then click Control Panel.
      • Double-click Administrative Tools, and then double-click Internet Information Services (IIS) Manager.
  2. In the Connections pane, expand the server name, and then go to the site, application, or directory where you want to enable WebDAV publishing.

  3. In the Home pane, double-click WebDAV Authoring Rules.
    Image of Home pane displaying Web DAV Authoring Rules selected.

  4. In the Actions pane, click Enable WebDAV.
    Image of Actions pane in Web DAV Authoring Rules page displaying Enable Web DAV option.

Note

Once you have enabled WebDAV publishing, you will need to add authoring rules before users or groups can publish content to your server. For more information about how to create authoring rules, see the authoringRules topic.

Configuration

The <authoring> element is configurable only at the site level in the ApplicationHost.config file. Any <authoring> elements at other levels or in Web.config files are ignored.

Attributes

Attribute Description
compatFlags Optional flags attribute.

Specifies the compatibility options for WebDAV. There are several behaviors that were used in previous versions of Microsoft's WebDAV implementations, and the flags in this attribute specify which of those behaviors the new WebDAV module will implement.

The compatFlags attribute can have one or more of the following possible values. If you specify more than one value, separate them with a comma (,). The default value is MsAuthorVia, MultiProp, CompactXml, IsHidden, IsCollection.
Value Description
None No compatibility options should be used.

The numeric value is 0.
MsAuthorVia

Specifies whether the WebDAV module should return the "MS-Author-Via" header to WebDAV clients.

Note: Some WebDAV clients expect this header.

The numeric value is 1.

MultiProp Specifies whether multiple <prop> statements should be allowed in WebDAV requests.

Note: This violates RFC 4918, but some earlier WebDAV implementations supported this syntax.


The numeric value is 2.
CompactXml Specifies whether the XML that is returned by the WebDAV module should be formatted hierarchically.

Note: Normally the WebDAV module will simply return XML responses with no CRLF characters and no indentation. This cuts down on the size of the data that is transmitted over the wire, but it's very difficult to read without an XML parser.

The numeric value is 4.
IsHidden Specifies that the IsHidden pseudo-live property should be supported.

Note: This property is an informal standard that is not defined in RFC 4918.

The numeric value is 8.
IsCollection Specifies that the IsCollection pseudo-live property should be supported.

Note: This property is an informal standard that is not defined in RFC 4918.

The numeric value is 16.
enabled Optional Boolean attribute.

true if WebDAV authoring is enabled; otherwise, false.

The default value is false.
maxAllowedXmlRequestLength Optional uint attribute.

Specifies the maximum length, in bytes, of the request XML body for WebDAV requests.

Note: This attribute was added in WebDAV 7.5 and IIS 7.5.

The default value is 1000000.
requireSsl Optional Boolean attribute.

true if SSL is required for WebDAV authoring; otherwise, false. Requiring SSL for WebDAV authoring adds an additional layer of security, but adds to the processing overhead for each request.

The default value is false.

Child Elements

Element Description
fileSystem Optional element.

Specifies how the WebDAV module interacts with the underlying file system.
locks Optional element.

Specifies the WebDAV locking settings.
properties Optional element. Specifies the WebDAV property settings.

Configuration Sample

The following example lists a sample <webdav> element for the Default Web Site. This example clears any existing authoring rules, adds a single rule for the administrators group, enables WebDAV authoring, specifies that hidden files are allowed, enables WebDAV locks and specifies the lock provider, and enables WebDAV properties and specifies the default XML namespace for property mapping.

<location path="Default Web Site">
   <system.webServer>
      <webdav>
         <authoringRules defaultAccess="none" allowNonMimeMapFiles="true" defaultMimeType="text/plain">
            <clear />
            <add roles="administrators" path="*" access="Read, Write, Source" />
         </authoringRules>
         <authoring enabled="true" requireSsl="false">
            <fileSystem allowHiddenFiles="true" />
            <locks enabled="true" lockStore="webdav_simple_lock" requireLockForWriting="false" />
            <properties allowAnonymousPropfind="false" allowInfinitePropfindDepth="false" allowCustomProperties="true">
               <clear />
               <add xmlNamespace="*" propertyStore="webdav_simple_prop" />
            </properties>
         </authoring>
      </webdav>
   </system.webServer>
</location>

Sample Code

The following examples enable WebDAV authoring for the Default Web Site, and configure the site so that SSL is not required for WebDAV authoring.

AppCmd.exe

appcmd.exe set config "Default Web Site" -section:system.webServer/webdav/authoring /enabled:"True" /requireSsl:"False"  /commit:apphost

Note

You must be sure to set the commit parameter to apphost when you use AppCmd.exe to configure these settings. This commits the configuration settings to the appropriate location section in the ApplicationHost.config file.

C#

using System;
using System.Text;
using Microsoft.Web.Administration;

internal static class Sample
{
   private static void Main()
   {
      using (ServerManager serverManager = new ServerManager())
      {
         Configuration config = serverManager.GetApplicationHostConfiguration();

         ConfigurationSection authoringSection = config.GetSection("system.webServer/webdav/authoring", "Default Web Site");
         authoringSection["enabled"] = true;
         authoringSection["requireSsl"] = false;

         serverManager.CommitChanges();
      }
   }
}

VB.NET

Imports System
Imports System.Text
Imports Microsoft.Web.Administration

Module Sample
   Sub Main()
      Dim serverManager As ServerManager = New ServerManager
      Dim config As Configuration = serverManager.GetApplicationHostConfiguration

      Dim authoringSection As ConfigurationSection = config.GetSection("system.webServer/webdav/authoring", "Default Web Site")
      authoringSection("enabled") = True
      authoringSection("requireSsl") = False

      serverManager.CommitChanges()
   End Sub
End Module

JavaScript

var adminManager = new ActiveXObject('Microsoft.ApplicationHost.WritableAdminManager');
adminManager.CommitPath = "MACHINE/WEBROOT/APPHOST";

var authoringSection = adminManager.GetAdminSection("system.webServer/webdav/authoring", "MACHINE/WEBROOT/APPHOST/Default Web Site");
authoringSection.Properties.Item("enabled").Value = true;
authoringSection.Properties.Item("requireSsl").Value = false;

adminManager.CommitChanges();

VBScript

Set adminManager = createObject("Microsoft.ApplicationHost.WritableAdminManager")
adminManager.CommitPath = "MACHINE/WEBROOT/APPHOST"

Set authoringSection = adminManager.GetAdminSection("system.webServer/webdav/authoring", "MACHINE/WEBROOT/APPHOST/Default Web Site")
authoringSection.Properties.Item("enabled").Value = True
authoringSection.Properties.Item("requireSsl").Value = False

adminManager.CommitChanges()

The following examples enable WebDAV locks for the Default Web Site by using the simple lock provider, and configure the site so that locks are not required for WebDAV authoring.

AppCmd.exe

appcmd.exe set config "Default Web Site" -section:system.webServer/webdav/authoring /locks.enabled:"True" /locks.lockStore:"webdav_simple_lock" /locks.requireLockForWriting:"False" /commit:apphost

Note

You must be sure to set the commit parameter to apphost when you use AppCmd.exe to configure these settings. This commits the configuration settings to the appropriate location section in the ApplicationHost.config file.

C#

using System;
using System.Text;
using Microsoft.Web.Administration;

internal static class Sample
{
   private static void Main()
   {
      using (ServerManager serverManager = new ServerManager())
      {
         Configuration config = serverManager.GetApplicationHostConfiguration();
         ConfigurationSection authoringSection = config.GetSection("system.webServer/webdav/authoring", "Default Web Site");

         ConfigurationElement locksElement = authoringSection.GetChildElement("locks");
         locksElement["enabled"] = true;
         locksElement["lockStore"] = @"webdav_simple_lock";
         locksElement["requireLockForWriting"] = false;

         serverManager.CommitChanges();
      }
   }
}

VB.NET

Imports System
Imports System.Text
Imports Microsoft.Web.Administration

Module Sample
   Sub Main()
      Dim serverManager As ServerManager = New ServerManager
      Dim config As Configuration = serverManager.GetApplicationHostConfiguration
      Dim authoringSection As ConfigurationSection = config.GetSection("system.webServer/webdav/authoring", "Default Web Site")

      Dim locksElement As ConfigurationElement = authoringSection.GetChildElement("locks")
      locksElement("enabled") = True
      locksElement("lockStore") = "webdav_simple_lock"
      locksElement("requireLockForWriting") = False

      serverManager.CommitChanges()
   End Sub
End Module

JavaScript

var adminManager = new ActiveXObject('Microsoft.ApplicationHost.WritableAdminManager');
adminManager.CommitPath = "MACHINE/WEBROOT/APPHOST";

var authoringSection = adminManager.GetAdminSection("system.webServer/webdav/authoring", "MACHINE/WEBROOT/APPHOST/Default Web Site");
var locksElement = authoringSection.ChildElements.Item("locks");
locksElement.Properties.Item("enabled").Value = true;
locksElement.Properties.Item("lockStore").Value = "webdav_simple_lock";
locksElement.Properties.Item("requireLockForWriting").Value = false;

adminManager.CommitChanges();

VBScript

Set adminManager = createObject("Microsoft.ApplicationHost.WritableAdminManager")
adminManager.CommitPath = "MACHINE/WEBROOT/APPHOST"

Set authoringSection = adminManager.GetAdminSection("system.webServer/webdav/authoring", "MACHINE/WEBROOT/APPHOST/Default Web Site")
Set locksElement = authoringSection.ChildElements.Item("locks")
locksElement.Properties.Item("enabled").Value = True
locksElement.Properties.Item("lockStore").Value = "webdav_simple_lock"
locksElement.Properties.Item("requireLockForWriting").Value = False

adminManager.CommitChanges()

The following examples configure the WebDAV property settings so that both anonymous and infinite depth property queries are disabled, and enable custom properties with the default XML namespace mapped to the built-in webdav_simple_prop provider.

AppCmd.exe

appcmd.exe set config "Default Web Site" -section:system.webServer/webdav/authoring /properties.allowAnonymousPropfind:"False" /commit:apphost

appcmd.exe set config "Default Web Site" -section:system.webServer/webdav/authoring /properties.allowInfinitePropfindDepth:"False" /commit:apphost

appcmd.exe set config "Default Web Site" -section:system.webServer/webdav/authoring /properties.allowCustomProperties:"True" /commit:apphost

appcmd.exe set config "Default Web Site" -section:system.webServer/webdav/authoring /+"properties.[xmlNamespace='*',propertyStore='webdav_simple_prop']" /commit:apphost

Note

You must be sure to set the commit parameter to apphost when you use AppCmd.exe to configure these settings. This commits the configuration settings to the appropriate location section in the ApplicationHost.config file.

C#

using System;
using System.Text;
using Microsoft.Web.Administration;

internal static class Sample
{
   private static void Main()
   {
      using (ServerManager serverManager = new ServerManager())
      {
         Configuration config = serverManager.GetApplicationHostConfiguration();
         ConfigurationSection authoringSection = config.GetSection("system.webServer/webdav/authoring", "Default Web Site");

         ConfigurationElement propertiesElement = authoringSection.GetChildElement("properties");
         propertiesElement["allowAnonymousPropfind"] = false;
         propertiesElement["allowInfinitePropfindDepth"] = false;
         propertiesElement["allowCustomProperties"] = true;

         ConfigurationElementCollection propertiesCollection = propertiesElement.GetCollection();

         ConfigurationElement addElement = propertiesCollection.CreateElement("add");
         addElement["xmlNamespace"] = @"*";
         addElement["propertyStore"] = @"webdav_simple_prop";
         propertiesCollection.Add(addElement);

         serverManager.CommitChanges();
      }
   }
}

VB.NET

Imports System
Imports System.Text
Imports Microsoft.Web.Administration

Module Sample
   Sub Main()
      Dim serverManager As ServerManager = New ServerManager
      Dim config As Configuration = serverManager.GetApplicationHostConfiguration
      Dim authoringSection As ConfigurationSection = config.GetSection("system.webServer/webdav/authoring", "Default Web Site")

      Dim propertiesElement As ConfigurationElement = authoringSection.GetChildElement("properties")
      propertiesElement("allowAnonymousPropfind") = False
      propertiesElement("allowInfinitePropfindDepth") = False
      propertiesElement("allowCustomProperties") = True

      Dim propertiesCollection As ConfigurationElementCollection = propertiesElement.GetCollection

      Dim addElement As ConfigurationElement = propertiesCollection.CreateElement("add")
      addElement("xmlNamespace") = "*"
      addElement("propertyStore") = "webdav_simple_prop"
      propertiesCollection.Add(addElement)

      serverManager.CommitChanges()
   End Sub
End Module

JavaScript

var adminManager = new ActiveXObject('Microsoft.ApplicationHost.WritableAdminManager');
adminManager.CommitPath = "MACHINE/WEBROOT/APPHOST";

var authoringSection = adminManager.GetAdminSection("system.webServer/webdav/authoring", "MACHINE/WEBROOT/APPHOST/Default Web Site");
var propertiesElement = authoringSection.ChildElements.Item("properties");
propertiesElement.Properties.Item("allowAnonymousPropfind").Value = false;
propertiesElement.Properties.Item("allowInfinitePropfindDepth").Value = false;
propertiesElement.Properties.Item("allowCustomProperties").Value = true;

var propertiesCollection = propertiesElement.Collection;

var addElement = propertiesCollection.CreateNewElement("add");
addElement.Properties.Item("xmlNamespace").Value = "*";
addElement.Properties.Item("propertyStore").Value = "webdav_simple_prop";
propertiesCollection.AddElement(addElement);

adminManager.CommitChanges();

VBScript

Set adminManager = createObject("Microsoft.ApplicationHost.WritableAdminManager")
adminManager.CommitPath = "MACHINE/WEBROOT/APPHOST"

Set authoringSection = adminManager.GetAdminSection("system.webServer/webdav/authoring", "MACHINE/WEBROOT/APPHOST/Default Web Site")
Set propertiesElement = authoringSection.ChildElements.Item("properties")
propertiesElement.Properties.Item("allowAnonymousPropfind").Value = False
propertiesElement.Properties.Item("allowInfinitePropfindDepth").Value = False
propertiesElement.Properties.Item("allowCustomProperties").Value = True

Set propertiesCollection = propertiesElement.Collection

Set addElement = propertiesCollection.CreateNewElement("add")
addElement.Properties.Item("xmlNamespace").Value = "*"
addElement.Properties.Item("propertyStore").Value = "webdav_simple_prop"
propertiesCollection.AddElement(addElement)

adminManager.CommitChanges()