Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to download a file from owncloud with curl, wget

I installed owncloud on the server!

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

I tried to download from console with following commands, but this not successfully:

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 web browser succesfully.

We used Owncloud v. 7.0.4, setuped with chef cookbook https://github.com/onddo/owncloud-cookbook

like image 221
vskubriev Avatar asked Dec 22 '14 12:12

vskubriev


Video Answer


1 Answers

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

#!/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
like image 189
Gerrit Griebel Avatar answered Sep 21 '22 10:09

Gerrit Griebel