0

Consider the download link

http://trac-hacks.org/changeset/latest/accountmanagerplugin/tags/acct_mgr-0.4.4?old_path=/&filename=accountmanagerplugin/tags/acct_mgr-0.4.4&format=zip

with the query part

?old_path=/&filename=accountmanagerplugin/tags/acct_mgr-0.4.4&format=zip

Downloading the file in firefox 37.0 causes the query to be resolved and a download of a .zip file while

wget 'http://trac-hacks.org/changeset/latest/accountmanagerplugin/tags/acct_mgr-0.4.4?old_path=/&filename=accountmanagerplugin/tags/acct_mgr-0.4.4&format=zip'

retrieves a file named acct_mgr-0.4.4?old_path=%2F&filename=accountmanagerplugin%2Ftags%2Facct_mgr-0.4.4&format=zip which one definitely should rename in order to work with it on the command line.

How to get wget to store the download as .zip with the correct name without the need to figure out this name (diff-from-_-14559-to-accountmanagerplugin_tags_acct_mgr-0.4.4-14559.zip in the example) and specify it to the -O/--output-document= option?

I checked How can I make wget rename downloaded files to not include the query string?, but adding --content-disposition doesn't help.

Kalle Richter
  • 2,212
  • 5
  • 40
  • 60
  • check http://superuser.com/questions/61025/how-can-i-make-wget-rename-downloaded-files-to-not-include-the-query-string?rq=1 – golimar Apr 28 '15 at 10:40
  • --content-disposition doesn't help because it's not recognized by wget? – golimar Apr 28 '15 at 12:46
  • @golimar I can only assume that it is recognized. How to check except that the download still has the same name instead of `.zip`? As far as I understood it only works when there's a disposition HTTP header in the response. – Kalle Richter Apr 28 '15 at 13:39
  • Check about that parameter in the wget manpage; also try --server-response to confirm that the server is using that header – golimar Apr 28 '15 at 14:12

0 Answers0