0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Python3 で Synology の WebDAV にアクセスする

Last updated at Posted at 2021-03-03

こちらと同じことを Python3 で行いました。
cadaver で Synology の WebDAV にアクセスする
https://qiita.com/ekzemplaro/items/493faac63ba863892f6f
Httpie で Synology の WebDAV にアクセスする

Ubuntu でライブラリーのインストール

sudo apt install python3-easywebdav

ファイルのアップロード

webdav_put.py
# ! /usr/bin/python
#
#	webdav_put.py
#
#						Mar/03/2021
# ------------------------------------------------------------------
import easywebdav

webdav = easywebdav.connect(
	'example.synology.me',
	username='scott',
	password='secret',
	protocol   = 'https',
	port=5006)

webdav.upload('./tmp01.txt', '/homes/scott/tmp/tmp01.txt')
#
# ------------------------------------------------------------------

ファイルのダウンロード

webdav_get.py
# ! /usr/bin/python
#
#	webdav_get.py
#
#						Mar/03/2021
# ------------------------------------------------------------------
import easywebdav

webdav = easywebdav.connect(
	'example.synology.me',
	username='scott',
	password='secret',
	protocol   = 'https',
	port=5006)

webdav.download('/homes/scott/tmp/tmp02.txt','./tmp02.txt')
#
# ------------------------------------------------------------------
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?