When I try to share a directory I get the following error:
Unhandled Exception: XmlParserException: "<" expected at 1:1
#0 new XmlDocument.parse (package:xml/src/xml/nodes/document.dart:35:7)
#1 sharesFromSharesXml (package:nextcloud/src/shares/share.dart:227:39)
#2 SharesClient.getShares (package:nextcloud/src/shares/client.dart:43:12)
My code:
// example of folderName: '/NewFolder'
Future<void> createShare(String folderNameToShare) {
var ncClient = NextCloudClient.withCredentials(Uri(host: baseUrl), "my@email.com", "myPassword");
await ncClient.webDav.mkdir(folderNameToShare);
await ncClient.shares.shareWithPublicLink(folderNameToShare, permissions: Permissions([
Permission.read, Permission.update
]));
}
The share url gets created on Nextcloud but the error as mentioned above occurs.
What I also noticed is that even though I used permissions: Permissions([Permission.read, Permission.update]) for the shareWithPublicLink function, the folder in the end only has read permissions on Nextcloud.
The same error as mentioned above occurs when I try to get the share link:
When I try to share a directory I get the following error:
My code:
The share url gets created on Nextcloud but the error as mentioned above occurs. What I also noticed is that even though I used
permissions: Permissions([Permission.read, Permission.update])
for theshareWithPublicLink
function, the folder in the end only has read permissions on Nextcloud.The same error as mentioned above occurs when I try to get the share link:
Any help again will be very welcome.