wget how to download zip files with query parameters attached to filename

2

I am sending a request to a clients server using wget. I want to download all the .zip files but the problem is the .zip files have key/values appended to the files. Like so:

http://example.com/client/photoshop-templates.zip?id=95923_324853&st=34258902386

The command I have used, without success is:

wget http://example.com/client/ -nd -r -L 1 -U="Mozilla/5.0 (Windows NT 5.1; rv:23.0) Gecko/20100101 Firefox/23.0" --no-cache -A .zip

Is wget reading the filename as something other than a zip file because of the key/values appended to the files?

James Jeffery

Posted 2014-09-18T15:42:30.407

Reputation: 295

What errors do you get? As it stands all we know is you are trying to use wet and that is it. – Mokubai – 2014-09-18T16:03:21.557

Are you just trying to strip off the parameters from the destination filename? See http://stackoverflow.com/questions/14129548/rename-file-by-removing-url-parameter-in-linux

– ssnobody – 2014-09-18T17:30:08.217

Answers

0

All you need to do is something like this:

wget -O photoshop-templates.zip http://example.com/client/photoshop-templates.zip?id=95923_324853&st=34258902386

or you can also try curl

curl -o photoshop-templates.zip http://example.com/client/photoshop-templates.zip?id=95923_324853&st=34258902386

Rob Calistri

Posted 2014-09-18T15:42:30.407

Reputation: 256