i want to create folders in my Nextcloud for many users. The users should only be able to upload files. That's why i wanted to write a script for that. Here i found a library for Python (like pyncclient) to create shares. To test the script i first create folders named by timestamp. With this folders i'm able to create shares, but the permission option is not working for me. I always only get read-only shares. Could someone please help me how to do that right?
My script:
import nextcloud_client
import time
timestr = time.strftime("%Y%m%d-%H%M%S")
nc = nextcloud_client.Client('http://domain.tld/nextcloud')
nc.login('user', 'password')
nc.mkdir(timestr)
link_info = nc.share_file_with_link(timestr, perms=4)
print("Here is your link: " + link_info.get_link())
Maybe there is a better library for that? Thanks.
Edit: I guess i found a workaround for the problem. I only need to update the permissions after i created the share:
nc.update_share(link_info.get_id(),perms=4)