Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

webdav functionality requires a different url from pure nextcloud functionality #61

Open
jcdufourd opened this issue Jun 13, 2024 · 2 comments

Comments

@jcdufourd
Copy link

I have tried creating a folder then adding a share to it using nextcloud-link and it fails.
The folder is not created and the share fails.

With the main url of the nextcloud server provided to the nextcloud-link client, adding a share on an existing folder works, but creating a folder does not.

If I add a folder with a generic webdav module, with the webdav-specific url provided in nextcloud files settings, it works.

The bug I suspect is that you need two different URLs in the client, one for webdav functionality and another for other functionality.

Using nextcloud 29

@kwisatz
Copy link
Member

kwisatz commented Jun 14, 2024

Hi @jcdufourd ,

Your assumption that two different endpoints (request paths) are responsible for creating a share and creating a directory is correct. The former uses the OCS API, while the latter uses WebDAV.

However, nextcloud-link should transparently use either one by passing just a single URL when initialising the client.

Could you please post a minimal failing example for what you're doing, so that we can try and reproduce your error?

@jcdufourd
Copy link
Author

import NextcloudClient from "nextcloud-link";

const client = new NextcloudClient(
{
"url": "https://myservername:33333/",
"username": “myadmin”,
"password": “pw”
});

// GroupFolders exists as a folder in the root directory of the myadmin user
await client.createFolderHierarchy('GroupFolders/'+nextcloudgroupname); // does nothing, no error, folder not created
await client.touchFolder('GroupFolders/'+nextcloudgroupname); // does nothing, no error, folder not created

// if I create the folder in the web interface
await client.shares.add('GroupFolders/'+nextcloudgroupname, 1, "leaders", 31); // works perfectly

And then:
await client.touchFolder(‘/GroupFolders/'+nextcloudgroupname); // works
await client.shares.add(‘/GroupFolders/'+nextcloudgroupname, 1, "leaders", 31); // works

What was confusing me is the fact that client.shares.add works with path without initial /, and touchFolder does not.

It is not a bug, just a minor inconvenience to maybe document.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants