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:
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
- On the taskbar, click Server Manager.
- In Server Manager, click the Manage menu, and then click Add Roles and Features.
- In the Add Roles and Features wizard, click Next. Select the installation type and click Next. Select the destination server and click Next.
- On the Server Roles page, expand Web Server (IIS), expand Web Server, expand Common HTTP Features, and then select WebDAV Publishing. Click Next.
- On the Select features page, click Next.
- On the Confirm installation selections page, click Install.
- On the Results page, click Close.
Windows 8 or Windows 8.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.
- In Control Panel, click Programs and Features, and then click Turn Windows features on or off.
- Expand Internet Information Services, expand World Wide Web Services, expand Common HTTP Features, and then select WebDAV Publishing.
- Click OK.
- Click Close.
Windows Server 2008 R2
- On the taskbar, click Start, point to Administrative Tools, and then click Server Manager.
- In the Server Manager hierarchy pane, expand Roles, and then click Web Server (IIS).
- In the Web Server (IIS) pane, scroll to the Role Services section, and then click Add Role Services.
- On the Select Role Services page of the Add Role Services Wizard, expand Common HTTP Features, select WebDAV Publishing, and then click Next.
- On the Confirm Installation Selections page, click Install.
- On the Results page, click Close.
Windows 7
- On the taskbar, click Start, and then click Control Panel.
- In Control Panel, click Programs and Features, and then click Turn Windows Features on or off.
- Expand Internet Information Services, then World Wide Web Services, and then Common HTTP Features.
- Select WebDAV Publishing, and then click OK.
Windows Server 2008 or Windows Vista
Download the installation package from the following URL:
Follow the instructions in the following walkthrough to install the WebDAV module:
How To
How to enable WebDAV publishing
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.
In the Connections pane, expand the server name, and then go to the site, application, or directory where you want to enable WebDAV publishing.
In the Home pane, double-click WebDAV Authoring Rules.
In the Actions pane, click Enable WebDAV.
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 .
|
||||||||||||||
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()