Я искал, как использовать клиент Sabre WebDAV, но, как бы я ни делал, у меня нет идея, как составить список файлов.
Код: Выделить всё
$folder_content = $client->propfind('', []);
Код: Выделить всё
array(5) {
["{DAV:}getlastmodified"]=>
string(29) "Thu, 18 Jul 2024 20:04:28 GMT"
["{DAV:}resourcetype"]=>
object(Sabre\DAV\Xml\Property\ResourceType)#14 (1) {
["value":protected]=>
array(1) {
[0]=>
string(16) "{DAV:}collection"
}
}
["{DAV:}quota-used-bytes"]=>
string(11) "11825361054"
["{DAV:}quota-available-bytes"]=>
string(13) "3286709522274"
["{DAV:}getetag"]=>
string(15) ""6699754ce26f9""
}
Код: Выделить всё
$client->propfind('', array(
'{DAV:}displayname',
'{DAV:}getcontentlength',
));
Код: Выделить всё
array(1) {
["{DAV:}displayname"]=>
string(47) "wedos-auth-modified-0f5f-4c87-99a2-modified"
}
Я нашел другие примеры использования propfind
Код: Выделить всё
$folder_content = $client->propfind('', array(
'{DAV:}getlastmodified',
'{DAV:}getcontenttype',
));
Код: Выделить всё
array(1) {
["{DAV:}getlastmodified"]=>
string(29) "Thu, 18 Jul 2024 20:04:28 GMT"
}
Код: Выделить всё
$features = $client->options();
Код: Выделить всё
array(8) {
[0]=>
string(1) "1"
[1]=>
string(1) "3"
[2]=>
string(14) "extended-mkcol"
[3]=>
string(14) "access-control"
[4]=>
string(40) "calendarserver-principal-property-search"
[5]=>
string(25) "nextcloud-checksum-update"
[6]=>
string(18) "nc-calendar-search"
[7]=>
string(27) "nc-enable-birthday-calendar"
}
Спасибо Оливье, мне удалось составить список с помощью
Код: Выделить всё
curl.exe https://cd.wedos.com/remote.php/dav/files/wedos-auth-anonymized/upload --user username:password --request PROPFIND
Однако я по-прежнему предпочитаю использовать клиент Sabre
Подробнее здесь: https://stackoverflow.com/questions/787 ... dav-client
Мобильная версия