Upload file
Tags: #owncloud #cloud #storage
Author: Jeremy Ravenel

Input

Install packages

1
!pip install pyocclient
Copied!

Import library

1
import naas
2
import owncloud
Copied!

Model

Connect to your ownCloud

1
oc = owncloud.Client('https://cloud.damken.com')
2
3
oc.login('YOURNAME', 'YOURPASS')
Copied!

Create a folder

1
oc.mkdir('testdir')
Copied!

Upload this file to your ownCloud

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

Output

Display result

1
print ("Here is your link: " + link_info.get_link())
Copied!
1
Copied!
Last modified 2mo ago
Copy link
Edit on GitHub