When using wget
in a script to download some files from Google Docs, the name of the file is not preserved. For example:
wget 'http://spreadsheets.google.com/pub?key=pyj6tScZqmEfbZyl0qjbiRQ&output=xls'
saves the file as pub?key=pyj6tScZqmEfbZyl0qjbiRQ
instead of indicatorhivestimatedprevalence15-49.xls
, which is what I get if I click on the link in a browser. Is there any way to enforce this "browser-like" behaviour in wget
?
.wgetrc
file! Just edit or create~/.wgetrc
and add a line that containscontent-disposition=on
.Here's some other useful things to put in your
– Chris Oct 09 '20 at 22:36~/.wgetrc
:compression=auto
,continue=on
,header = User-Agent: ....
,server_response = on
, etc..