Download files from different file owners via webdav


#1

Hello!

I want to download files via webdav. I’m using an URL like this: localhost:8080/remote.php/dav/files/admin/testfile.xml
with basic auth header admin:$password
Is it possible to download files from different users with this authentication as well? When i try to download a file from localhost:8080/remote.php/dav/files/test/testfile.xml
i get the following response

<?xml version="1.0" encoding="utf-8"?>
<d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">
    <s:exception>Sabre\DAV\Exception\NotFound</s:exception>
    <s:message>File not found: testfile.txt in 'test'</s:message>
</d:error> 

Is it possible to download files from other users? Can I create something like a technical user that can download files from other users?
Or is there a completly different approach to download files?

Regards

Fabian


#2

AFAIK no such possibility exists, unless knowing and using other users credentials.


#3

Or sharing with such user or group. Or using the impersonation app - but that one does currently not have an API.
By purpose ownCloud, by default, does not allow the admin to have access to user data.

So the easiest way is that the users share data with a function user and you use that one in the API.


#4

Thank you for your responses!

Is it possible to write my own App that has a REST endpoint that provides the requested files? Can i access the files via php or do i encounter the same auth issues?


#5

I might be wrong, but I think you’ll end up with the same issue. There is no such thing like a superuser, capable accessing other peoples files.


#6

Thank you again!
Looks like i have to take a different approach.