1

I want to download files from my Nextcloud using a shortcut. This command works in the cmd console, but I don’t know how to do this with the Siri Shortcuts app:

curl -u username:password -X GET "https://mycloud.com/index.php/apps/files/?dir=/&fileid=48083" -H "OCS-APIRequest: true"

Has anyone experiences with this topic?

1 Answers1

1

After not really finding anything and even their own documentation stating that it should be easy, while not talking about what they mean by user or username, I did manage to download via:

curl -u "your_nextcloud_username":"your_nextcloud_password" "https://mycloud.com/remote.php/webdav/path/to/file.ending" -o "file.ending"

Now I would not say this is ideal. I had originally planned to use the share link and the share password for security, since that would mean not exposing my own password, but I can't work out what other endpoint or headers it wants for that and the documentation doesn't seem to mention this either.

Maybe it helps you.

EDIT:

I finally made sense of that comment posted on the nextcloud forums. Apparently the request is routed directly not requiring the file name in the url part. This means it is as simple as:

curl -u "SHARE_ID":"SHARE_PASSWORD" -H "X-Requested-With: XMLHttpRequest" "https://mycloud.com/public.php/webdav/"

Not sure if this works with entire folders.

user2280032
  • 372
  • 2
  • 5
  • 16