Replies: 1 comment
-
if __name__ == "__main__":
from datetime import datetime, timedelta
import nc_py_api
nc = nc_py_api.Nextcloud(nc_auth_user="admin", nc_auth_pass="admin", nextcloud_url="http://stable29.local")
with open(__file__) as fp:
upload = nc.files.upload_stream('dev3.py', fp)
print(str(upload))
share = nc.files.sharing.create(
upload, share_type=3, permissions=1, password="temp", expire_date=datetime.now() + timedelta(weeks=1)
)
print(share.url) Output:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've got the following code. Uploading the file works properly, but sharing gives me a Typerror when calling update.
I'm assuming I have to run Update after creating the share, as trying to remove the update function call runs successfully, but when I go to the web interface there's no share created, and trying to print the URL via print(share.url()) gives me a Recursion error (maximum recursion depth exceeded).
Code Snippet:
Beta Was this translation helpful? Give feedback.
All reactions