Sunday, May 5, 2024
 Popular · Latest · Hot · Upcoming
101
rated 0 times [  101] [ 0]  / answers: 1 / hits: 30639  / 1 Year ago, thu, march 9, 2023, 5:00:14

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?


More From » wget

 Answers
3
wget --content-disposition 'http://spreadsheets.google.com/pub?key=pyj6tScZqmEfbZyl0qjbiRQ&output=xls'


will do the trick for you.



Its still not fully implemented and seems to bug out a bit sometimes so its not the default option in wget, use it at your own risk.


[#42175] Friday, March 10, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
rontablis

Total Points: 293
Total Questions: 123
Total Answers: 104

Location: Austria
Member since Mon, Mar 1, 2021
3 Years ago
;