pyocclient: share_file_with_user error

oc.share_file_with_user( "/home/prc/oc/path", "ee14ea28-b869-1036-8080-9dbd8c6b1579@b2drop.eudat.eu");

Gives me following error:

  File "test.py", line 19, in <module>
    oc.share_file_with_user( "/home/prc/oc/path", "ee14ea28-b869-1036-8080-9dbd8c6b1579@b2drop.eudat.eu");
  File "/usr/local/lib/python2.7/dist-packages/owncloud/owncloud.py", line 1246, in share_file_with_user
    self._check_ocs_status(tree)
  File "/usr/local/lib/python2.

I have around 200 files to share. By GUI it is takes very long time to share each one by hand 😦

[Q] How could I fix this error? Thank you for your valuable time and help.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 16 (9 by maintainers)

Most upvoted comments

After looking at the source code, everything seems to be ready for sharing with federated users. In order to do that, you have to use the keyword argument remote_user=True.

Example:

oc.share_file_with_user('myfile', 'user@domain.fr/owncloud/', remote_user=True)

Be careful with the final /, it doesn’t work without it ! Hope that helps !

Rémi.

A function is missing to share with federated users, to be added later.