Downloading a password protected shared file from commandline

9.1.x
help

#1

I've looked at many different resources, trying to figure out how to do this, but I haven't had any luck - I shared a file and I have a URL in this format

https://owncloud.example.com/index.php/s/<file ID>/download

and it is password protected. How do I use curl or wget to download the file?

I have files I want to allow others to download directly to their Linux machine instead of them needing to download it on their machine then moving it to their server.

I was looking at some examples and they mentioned the use of webdav to do it, but I wasn't able to figure out the correct way to set this up.

Thanks


#2

Hi,

you can access public shared links via WebDAV and curl like explained here:

https://doc.owncloud.org/server/latest/user_manual/files/access_webdav.html#accessing-public-shares-over-webdav


#3

Alright thanks, I got it. It looks like this:

curl -u "<share token>:<password>" "https://owncloud.example.com/public.php/webdav" -o <filename>