documentation icon indicating copy to clipboard operation
documentation copied to clipboard

Documentation; Requesting folder and file count

Open timosturm opened this issue 3 years ago • 0 comments

curl -u username:password 'https://cloud.example.com/remote.php/dav/files/username/folder' -X PROPFIND --data '<?xml version="1.0" encoding="UTF-8"?>
 <d:propfind xmlns:d="DAV:">
   <d:prop xmlns:oc="http://owncloud.org/ns">
        <nc:contained-folder-count />
        <nc:contained-file-count />
   </d:prop>
 </d:propfind>'

(see https://docs.nextcloud.com/server/latest/developer_manual/client_apis/WebDAV/basic.html#requesting-properties) returns

<?xml version="1.0" encoding="utf-8"?>
<d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">
  <s:exception>Sabre\DAV\Exception\BadRequest</s:exception>
  <s:message>Namespace prefix nc on contained-folder-count is not defined
 on line 4, column 32</s:message>
</d:error>

Replacing nc with oc returns <d:propstat><d:prop><oc:contained-folder-count/><oc:contained-file-count/></d:prop><d:status>HTTP/1.1 404 Not Found</d:status> for all folders and files in folder.

Is this an error in the documentation? Does this require some special server configuration to work?

timosturm avatar Apr 16 '22 18:04 timosturm