python - 使用 Python 将图像上传到 WebDav 服务器
问题描述
我正在尝试将图像上传到 WebDAV 服务器。服务器托管在 Linux 服务器上,我们可以使用 URL 在 WebDAV 服务器中显示图像。我只是想做一个简单的上传。
from webdav3.client import Client
options = {
'webdav_hostname': "http://www.link.com/webdav/",
'webdav_login': "user",
'webdav_password': "user"
}
if __name__ == '__main__':
client = Client(options)
client.upload_file(remote_path='blank.php/webdav/converted_images',
local_path="../Downloads/download.jpeg")
我收到以下错误:
Traceback (most recent call last):
File "/home/user/webDav_test/test.py", line 30, in <module>
local_path="../Downloads/download.jpeg")
File "/home/user/.local/lib/python3.7/site-packages/webdav3/client.py", line 70, in _wrapper
res = fn(self, *args, **kw)
File "/home/user/.local/lib/python3.7/site-packages/webdav3/client.py", line 491, in raise RemoteParentNotFound(urn.path())
webdav3.exceptions.RemoteParentNotFound: Remote parent for: /webdav/converted_images not found
解决方案
推荐阅读
- python - 如何使用定义的数学函数在 matplotlib.quiver() 中创建 U、V 参数
- excel - 如何在消除任何尾随空白单元格的同时获得粘贴数据的功能?
- c++ - 排序算法前k个元素
- firebase - Firestore 安全规则 - 如何只允许地图内的地图中的某些字段
- python - 使用 2 for 循环
- neural-network - 反向传播如何适用于多个隐藏网络?
- python - 将列表中的值输入到空字典 Python
- java - Spring JPA - org.hibernate.LazyInitializationException:无法初始化代理 - 没有会话
- javascript - 格式化一些数据以作为多连字符字符串名称传递
- java - Hystrix 中metrics.rollingStats.numBuckets 的目的是什么?