Comments (5)
It's not clear if this is library problem or the WebDAV server misconfiguration.
What HTTP request are you sending? What HTTP response are you getting?
A good starting point is too use a tool like Fiddler to capture HTTP/HTTPS traffic between the application and the WebDAV server and see what kind of response the WebDAV server returns.
If the field is not present in the HTTP response of WebDAV server then it's the expected behavior of the library; otherwise you can send me the WebDAV response and I can investigate if it's a bug in the lib.
To proxy WebDAV calls through Fiddler you need to pass a WebProxy instance to WebDavClient like explained here.
from webdavclient.
Also a displayname property is optional and some WebDAV servers simply don't return it by default.
However, you can include it in a request as an additional property:
var propfindParams = new PropfindParameters
{
CustomProperties = new[] { XName.Get("displayname", "DAV:") }
};
or
var propfindParams = new PropfindParameters
{
CustomProperties = new[] { XName.Get("displayname", "DAV:") },
RequestType = PropfindRequestType.NamedProperties
};
from webdavclient.
I'm having the same problem and your suggestion of using PropfindParameters
to request displayname
explicitly does not seem to help. The WebDAV server is a Synology NAS. I'm on Linux and if I add the WebDAV server to the Nautilus file explorer under Other Locations, all the directory and file names display correctly, so they must be available somehow.
Here is what is returned for one file:
Name:
IsCollection: False
ContentType:
ContentLength: 2933
I dumped the WebDavResource.Properties
and these are the names -> values
found:
{DAV:}resourcetype ->
{DAV:}creationdate -> 2023-01-26T10:16:38Z
{DAV:}getcontentlength -> 2933
{DAV:}getlastmodified -> Fri, 27 Jan 2023 09:47:06 GMT
{DAV:}getetag -> "b75-5f33bbf8f1a80"
{http://apache.org/dav/props/}executable -> T
{DAV:}supportedlock -> <lp1:lockentry xmlns:lp1="DAV:"><lp1:lockscope><lp1:exclusive /></lp1:lockscope><lp1:locktype><lp1:write /></lp1:locktype></lp1:lockentry><lp1:lockentry xmlns:lp1="DAV:"><lp1:lockscope><lp1:shared /></lp1:lockscope><lp1:locktype><lp1:write /></lp1:locktype></lp1:lockentry>
{DAV:}lockdiscovery ->
There is no mention of displayname
. Any idea what I'm doing wrong?
from webdavclient.
I can use curl
to make the WebDAV call:
curl -i -X PROPFIND -H "Depth: 1" 'https://<location>' -u <user>
The result contains responses like this:
<D:response xmlns:lp1="DAV:"
xmlns:lp2="http://apache.org/dav/props/">
<D:href>/home/Drive/Bangle/putrid-position.md</D:href>
<D:propstat>
<D:prop>
<lp1:resourcetype/>
<lp1:creationdate>2022-12-20T10:45:31Z</lp1:creationdate>
<lp1:getcontentlength>31</lp1:getcontentlength>
<lp1:getlastmodified>Tue, 20 Dec 2022 10:45:29 GMT</lp1:getlastmodified>
<lp1:getetag>"1f-5f04022626440"</lp1:getetag>
<lp2:executable>T</lp2:executable>
<D:supportedlock>
<D:lockentry>
<D:lockscope>
<D:exclusive/>
</D:lockscope>
<D:locktype>
<D:write/>
</D:locktype>
</D:lockentry>
<D:lockentry>
<D:lockscope>
<D:shared/>
</D:lockscope>
<D:locktype>
<D:write/>
</D:locktype>
</D:lockentry>
</D:supportedlock>
<D:lockdiscovery/>
</D:prop>
<D:status>HTTP/1.1 200 OK</D:status>
</D:propstat>
</D:response>
The last piece of the <D:href>
path is the displayname
information I need.
from webdavclient.
I just discovered that you expose the href
path as the Uri
property. This means I have everything I need.
from webdavclient.
Related Issues (20)
- Initializing with httpclient gives 401 Unauthorized HOT 2
- Upload file to webdav using a stream HOT 4
- How to download a file? HOT 2
- Is it possible to get a preview URL?
- upload file Exceptions - Missing IsExist Method
- download file is not working ...
- implementation of HTTP SEARCH method HOT 3
- implementation of HTTP SEARCH method
- How to disable SSL certificate validation? HOT 3
- Get folder URI by fileid property
- Implement advanced search
- Is it possible to create directory? HOT 1
- Directory tree with MKCOL
- Retrieving folders and files in an arabic language is not correct
- Download large files HOT 1
- How to sent data with mkcol?
- Invalid XML in WebDav server responses do not result in a usable exception
- Webdav restart while uploading file. Webdav upload error (async upload, largest file, parallel request)
- Set lastmodified date
- 207 Multi-Status response not parsed correctly
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from webdavclient.