通过WebDAV脚本标记NextCloud文件 [英] NextCloud file tagging through WebDAV script
问题描述
我正在使用NextCloud 11存储我的个人文件,并且使用文档中的简单curl脚本将文件上传到我的NextCloud驱动器:
I am using NextCloud 11 to store my personal files, and I use the simple curl script from the documentation in order to upload files to my NextCloud drive:
curl -u user:pw -T test.pdf "http://localhost/nextcloud/remote.php/dav/files/user/test/test.pdf"
此外,我想直接在上传的文件中添加一些标签.但是,在官方文档中,它们只是说明如何通过WebDAV界面上载,删除和移动文件.
Moreover, I would like to directly add some tags to the uploaded files. However, in the official documentation, they just show how files can be uploaded, deleted and moved through the WebDAV interface.
有人提示我如何远程标记文件吗?
Does anybody have a hint how I could tag a file remotely?
我已在NextCloud官方论坛上发布了相同的问题,但我尚未收到任何回复.万一收到回复,我会在这里发布.
I have posted the same question in the official NextCloud community forum, but I did not receive a response yet. In case I receive a response, I will post it here.
推荐答案
POST 有效载荷是JSON:
{"tags": ["tag1", "tag2"]}
您将需要使用基本身份验证进行身份验证
You will need to authenticate yourself using Basic Auth
由于需要CSRF令牌,因此只能从Nextcloud内部调用该API.
The API can only be called from inside Nextcloud because the CSRF token is required.
这篇关于通过WebDAV脚本标记NextCloud文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!