Unable to download shared files with Ubuntu (wget)

10

#1

Steps to reproduce

1.Create a public share link for a file
2. Copy the direct download link from the webinterface
3. Go in Ubuntu (only tested in Ubuntu 16.04 and 18.04) and enter “wget LINK”

  1. LITTLE EDIT: I tried to downlod a Word document… it downloaded with that name download again, but as .ZIP archive…

  2. ANOTHER EDIT: I tried a .pdf file, it worked, but also named “download”

Expected behaviour

Downloading the file

Actual behaviour

File is getting downloaded, but as .txt file called “download”, but it actually does download the full file (size)

Server configuration

Operating system: Ubuntu 16.04/18.04

Web server: Apache2

Database: MySQL

PHP version: 7.0.30

ownCloud version: 10.0.8

Updated from an older ownCloud or fresh install: Fresh install

Where did you install ownCloud from: Normal apt-get installation

Signing status (ownCloud 9.0 and above): -

Login as admin user into your ownCloud and access 
http://example.com/index.php/settings/integrity/failed 
paste the results into https://gist.github.com/ and puth the link here.

No errors found

The content of config/config.php:
https://pastebin.com/J1VfPBGN

Log in to the web-UI with an administrator account and click on
'admin' -> 'Generate Config Report' -> 'Download ownCloud config report'
This report includes the config.php settings, the list of activated apps
and other details in a well sanitized form.

or 

If you have access to your command line run e.g.:
sudo -u www-data php occ config:list system
from within your ownCloud installation folder

*ATTENTION:* Do not post your config.php file in public as is. Please use one of the above
methods whenever possible. Both, the generated reports from the web-ui and from occ config:list
consistently remove sensitive data. You still may want to review the report before sending.
If done manually then it is critical for your own privacy to dilligently
remove *all* host names, passwords, usernames, salts and other credentials before posting.
You should assume that attackers find such information and will use them against your systems.

List of activated apps:

  • All default apps
  • Polls
  • 2FAUTH
If you have access to your command line run e.g.:
sudo -u www-data php occ app:list
from within your ownCloud installation folder.

Are you using external storage, if yes which one: not in use

Are you using encryption: no

Are you using an external user-backend, if yes which one: not in use


Client configuration

Browser: Firefox

Operating system: Does not matter, but Windows and or Ubuntu

Logs

Web server error log

Insert your webserver log here

ownCloud log (data/owncloud.log)

Insert your ownCloud log here

Browser log

Insert your browser log here, this could for example include:

Not needed

#2

That’s how wget works. It just tries to infer the name of the file from the url.

Try with wget --content-disposition <your-link>. wget will try to get the name from the content-disposition header from the requests.
You can also use the -O option to set whatever name you want.

Basically, wget is just downloading whatever content the server sends and writing the content in a file. You aren’t downloading a file with the name and all attributes and metadata the file could have.