I get an error 403 with my Delphi WebDAV program nor CarotDAV client works fine

568 Views Asked by At

I have a IIS and WebDAV under windows 10. Now I tried Delphi 10.4 Webdav component from /n Software which works fine for retrieving a particular file via WebDAV in SSL mode (https). But when I want to try to get the Directory listing I get an HTTP ERROR 403. In the log File on the server I see that the PROPFIND entry has the 403 Error note. It is similar that reason: IIS-403 err

HAs anyone here an idea where I could solve this problem. Thanks a lot.

1

There are 1 best solutions below

0
On

The reason is: (Answered by Hugh Wright from /n software)

There are several potential causes for this error. Previous users who have had similar errors fixed it by changing the depth property of the WebDAV component. By default, the WebDAV component uses a depth of infinity when calling certain methods, including FindProperties and ListDirectory. Some servers do not support requests with a depth of infinity, and may return a 403 error when the request is made.

 Webdav1.User := 'username';
 Webdav1.Password := 'password';
 Webdav1.AuthScheme := authBasic;
 Webdav1.Depth := dpImmediateChildren; // The server will operate on the

                                    // collection resource URI and all of

                                    // its immediate member resources (but

                                    // on none of their member resources).

 Webdav1.FindProperties('ResourceURI'); 

I was able to confirm that the issue was the Depth Property. By default, CarotDAV uses a depth of 1 (Immediate Children), and our component does not.