Links

Upload file

Tags: #owncloud #cloud #storage #operations #snippet
Author: Jeremy Ravenel​

Input

Install packages

!pip install pyocclient

Import library

import naas
import owncloud

Model

Connect to your ownCloud

oc = owncloud.Client('https://cloud.damken.com')
​
oc.login('YOURNAME', 'YOURPASS')

Create a folder

oc.mkdir('testdir')

Upload this file to your ownCloud

oc.put_file('testdir/upload_to_owncloud.ipynb', 'upload_to_owncloud.ipynb')
link_info = oc.share_file_with_link('testdir/upload_to_owncloud.ipynb')

Output

Display result

print ("Here is your link: " + link_info.get_link())
​
Last modified 1mo ago