我的 Delphi WebDAV 程序出现错误 403,CarotDAV 客户端也无法正常工作 [英] I get an error 403 with my Delphi WebDAV program nor CarotDAV client works fine

查看:47
本文介绍了我的 Delphi WebDAV 程序出现错误 403,CarotDAV 客户端也无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Windows 10 下有一个 IIS 和 WebDAV.现在我尝试了来自/n Software 的 Delphi 10.4 Webdav 组件,它可以很好地在 SSL 模式 (https) 下通过 WebDAV 检索特定文件.但是当我想尝试获取目录列表时,我得到一个 HTTP 错误 403.在服务器上的日志文件中,我看到 PROPFIND 条目有 403 错误注释.原因类似:IIS-403 错误

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.

推荐答案

原因是:(由/n software 的 Hugh Wright 回答)

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

此错误有多种潜在原因.以前遇到过类似错误的用户通过更改 WebDAV 组件的深度属性来修复它.默认情况下,WebDAV 组件在调用某些方法(包括 FindProperties 和 ListDirectory)时使用无穷大深度.部分服务器不支持深度为无穷大的请求,请求时可能会返回 403 错误.

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'); 

我能够确认问题出在深度属性上.默认情况下,CarotDAV 使用深度 1(直接子代),而我们的组件不使用.

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.

这篇关于我的 Delphi WebDAV 程序出现错误 403,CarotDAV 客户端也无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆