Any way to add/set custom webdav props in php(Controller/ApiController) instead of http request?

Hello while creating my Application written in ApiControllers, I found there seems no way to access webdav node properties in php frameworks.

For example, I am going to have a event listener that automatically writes properties like
{http://owncloud.org/ns}checksum
{http://foo.com/ns}bar
to webdav immediately after the file is uploaded to webdav.

And also a ApiController that is able to write
{http://foo.com/ns}bar
properties in some calls.

But I’d like them to be done without making a new http request for the sake of performance and preventing redundant event dispatching.

Any one can help on this? Thanks in advance.:slight_smile:

SabrePlugin is what you are looking for.

Did you mean this one? I can find it in /3rdparty/sabre/ but I didn’t got the way to use it in my Controllers. Is there any documentation that I can refer to? Thanks.

Sabre is a component used by Nextcloud for dav. If you want to react on custom dav properties you want to write a SabrePlugin.

About sabre plugins in general: https://sabre.io/dav/writing-plugins/

To register a sabre plugin info.xml:

Make sure your app is loaded for dav requests:

Here is an example how on a propfind request the fileid property is processed:

1 Like

@kesselb Thanks very much!! I’ll try to make one.

It works!! @kesselb Thanks very much.

1 Like