uppy icon indicating copy to clipboard operation
uppy copied to clipboard

[companion] WebDAV import does not work with oCIS public links

Open LukasHirt opened this issue 3 months ago • 8 comments

Initial checklist

  • [x] I understand this is a bug report and questions should be posted in the Community Forum
  • [x] I searched issues and couldn’t find anything (or linked relevant results below)

Link to runnable example

No response

Steps to reproduce

  1. login with the demo user here https://demo.owncloud.com/
  2. create a folder
  3. create a public link for that folder
  4. using companion, try to import that directory via WebDAV

Expected behavior

Content of the folder would be displayed.

The problem lies in a different path that ownCloud 10 and Nextcloud are using compared to oCIS (ownCloud Infinite Scale). All three are using the same public links (https://example.com/s/kFy9Lek5sm928xP) so they are all matched here https://github.com/transloadit/uppy/blob/b7605df9402e4db9b02828bf24558e21eae76637/packages/%40uppy/companion/src/server/provider/webdav/index.js#L35

But while oC10 and Nextcloud use /public.php/webdav/, oCIS uses /dav/public-files/{public_token}.

Actual behavior

The following error is thrown: Caused by: HttpError: Failed request with status: 500. Internal Server Error message: Invalid response: No root multistatus found

LukasHirt avatar Oct 08 '25 08:10 LukasHirt

To confirm that the different path is the only issue with the broken oCIS links, I run companion locally with the following line https://github.com/transloadit/uppy/blob/b7605df9402e4db9b02828bf24558e21eae76637/packages/%40uppy/companion/src/server/provider/webdav/index.js#L39 changed to:

url: `${baseURL}/dav/public-files/${publicLinkToken}`,

and it worked without any issue.

LukasHirt avatar Oct 08 '25 08:10 LukasHirt

Note: ownCloud 10 can work with {base}/remote.php/dav/public-files/{token} as well. I haven't been able so far to test this with Nextcloud though.

LukasHirt avatar Oct 08 '25 09:10 LukasHirt

ownCloud 10 can work with {base}/remote.php/dav/public-files/{token} as well.

Finally managed to test this with Nextcloud v32. Unfortunately, it does not seem to work there.

LukasHirt avatar Oct 08 '25 09:10 LukasHirt

is there any way to discover which URL should be used, e.g. from a standardized meta endpoint or something like that?

mifi avatar Nov 17 '25 17:11 mifi

is there any way to discover which URL should be used, e.g. from a standardized meta endpoint or something like that?

All three products define capabilities endpoint. Every response include information about version:

ownCloud 10

"core" : {
  "webdav-root" : "remote.php/webdav",
  "status" : {
    "edition" : "Community",
    "installed" : "true",
    "needsDbUpgrade" : "false",
    "versionstring" : "10.0.3",
    "productname" : "ownCloud",
    "maintenance" : "false",
    "version" : "10.0.3.3"
   },
}

Nextcloud

<version>
  <major>17</major>
  <minor>0</minor>
  <micro>2</micro>
  <string>17.0.2</string>
  <edition></edition>
  <extendedSupport></extendedSupport>
</version>

oCIS

{
    "major": 10,
    "minor": 11,
    "micro": 0,
    "string": "10.11.0",
    "edition": "Community",
    "product": "Infinite Scale",
    "productversion": "7.3.0"
}

As you can see, oCIS returns "product": "Infinite Scale". Maybe that could be matched to assert the correct URL?

LukasHirt avatar Nov 18 '25 07:11 LukasHirt

Is the capabilities endpoint a fixed URL path shared by all providers, or does it also differ? If it differs, then i don’t see how we can use that to determine which url to use

mifi avatar Nov 18 '25 08:11 mifi

All should support the same endpoint /ocs/v1.php/cloud/capabilities. oCIS does not care about the version in this specific endpoint and supports both v1.php and v2.php.

LukasHirt avatar Nov 18 '25 09:11 LukasHirt

Ok cool! But the returned format of data is completely different for each provider it seems. That makes it hard to determine the URL from the response

mifi avatar Nov 18 '25 09:11 mifi