How to download a file from owncloud with curl, wget

I installed owncloud on the server!

How can I download a shared file with a link provided by the WebUI from the console using wget or curl?

I tried to load the following commands from the console, but this failed:

wget http://owncloud.example.com/public.php?service=files&t=par7fec5377a27f19654cd0e7623d883 wget http://owncloud.example.com/public.php?service=files&t=par7fec5377a27f19654cd0e7623d883 wget http://owncloud.example.com/public.php?service=files&t=par7fec5377a27f19654cd0e7623d883&download -O file.tar.gz wget http://owncloud.example.com/public.php?service=files&t=par7fec5377a27f19654cd0e7623d883&download -O file.tar.gz 

I can download this file from a web browser successfully.

We used Owncloud v. 7.0.4 configured using the cook's cookbook https://github.com/onddo/owncloud-cookbook

+6
source share
2 answers

Something like below worked for me.

 wget --no-check-certificate "http://owncloud.example.com/public.php?service=files&t=par7fec5377a27f19654cd0e7623d883&download&path=//file.tar.gz" 

Note the double quotes around the download link.
The URL was "copied by the download link" from the downloads in chrome.

+4
source

To download the list of numbered password-protected files, use the Copy as cURL function of the Chrome developer ( http://www.lornajane.net/posts/2013/chrome-feature-copy-as-curl ) to get the cURL command with a cookie, then copy the name of the first file to load the script file:

 #!/bin/bash for number in $(seq -w 37) do curl -o "file.part0$number.zip" "<URL of first file including $number>" \ -H parameters from "Copy as cURL" done 
+3
source

Source: https://habr.com/ru/post/980033/


All Articles