4

I'm trying to download all the files at the main link, they all download, but are named as per the separate shortlink

wget –content-disposition -i http://ligman.me/2sZVmcG

One of the results:

--2017-08-03 12:12:16--  http://ligman.me/1IW1oab
Connecting to ligman.me (ligman.me)|67.199.248.12|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: http://download.microsoft.com/DOWNLOAD/D/6/7/D670D322-5771-409E-BF34-5B98496DEB0A/MICROSOFT_PRESS_EBOOK_INTRODUCING_AZURE_PDF.PDF [following]
--2017-08-03 12:12:16--  http://download.microsoft.com/DOWNLOAD/D/6/7/D670D322-5771-409E-BF34-5B98496DEB0A/MICROSOFT_PRESS_EBOOK_INTRODUCING_AZURE_PDF.PDF
Resolving download.microsoft.com (download.microsoft.com)... 23.211.1.18, 2a02:26f0:ce:29c::e59, 2a02:26f0:ce:298::e59
Connecting to download.microsoft.com (download.microsoft.com)|23.211.1.18|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 8395026 (8.0M) [application/octet-stream]
Saving to: ‘1IW1oab.2’

1IW1oab.2                                    100%[===============================================================================================>]   8.01M  5.17MB/s   in 1.5s

2017-08-03 12:12:18 (5.17 MB/s) - ‘1IW1oab.2’ saved [8395026/8395026]

How can I get wget to save the file as it's original name, which can quite clearly be 'seen'?

1 Answer 1

6

Option --trust-server-names should do this.

--trust-server-names

If this is set to on, on a redirect the last component of the redirection URL will be used as the local file name. By default it is used the last component in the original URL.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .