Thursday, October 26, 2006

Setting up Windows XP SP2 as a WEBDAV client

[ This is just a personal note for myself, but of course I hope it can be useful for the others, too :D ]

On setting up Windows XP SP2 as a WEBDAV client, I referred to this webpage. However, it didn't let me upload files to the server, without asking me for any username and password. I checked further in the Internet and found the reason and solution. It seems that Windows XP SP2 turned the necessary BasicAuth parameter off. To enable it, you should add the following key to the registry with regedit and set its value to non-zero.

HKEY_LOCAL_MACHINE\SYSTEM \CurrentControlSet\Services\WebClient\Parameters\UseBasicAuth (DWORD)

I am not sure about other environments, but on my machine, this alone didn't help much. The response of the client was painfully slow. I don't remember where I read about this, but if you add a tailing "~" to the address of the WEBDAV folder that you are accessing, some black magic is done in the background and your problem goes away.

For example, instead of saying "http://www.mydomain.com/", you should say "http://www.mydomain.com/~".

The above solution solved the authentication problem partially. It still doesn't allow me to drag-and-drop files into the WEBDAV folder directly. And here is a trick to do that. Right after you open the WEBDAV folder, right click on the empty space inside the folder, and choose "Create new folder", then it will (hopefully) ask you for your username and password. Enter your username and password here, and check the box to remember it so that you don't have to do this again the next time.

And this is how I have done it and I hope it helps you, too.

1 comment:

koyi said...

In later versions of Windows, you might need another workaround as written in wikipedia.

>>>
Microsoft introduced WebDAV client support in Windows 98 with a feature called "Web folders". This client was simply an extension to Windows Explorer (the desktop/file manager) and later included in Windows 2000. In Windows XP, Microsoft changed the client to the "WebDAV mini-redirector". This new client works at the filesystem level, allowing WebDAV shares to be assigned to a drive letter and used by all software. However, all versions of the redirector have serious bugs[1]. It has been known to try to convert HTTP URLs to UNC paths e.g http://host/path/ to \\host\path\. It also often uses Windows Domain authentication when answering HTTP basic-auth challenges. One known fix which may work around the first problem is to explicitly specify the port number in the URL e.g http://host:80/path/. This reportedly forces the use of the old "Web folders" client.
<<<