Downloading a file from the internet with '&' in URL using wget
Posted
by
matt_tm
on Super User
See other posts from Super User
or by matt_tm
Published on 2011-02-06T03:33:10Z
Indexed on
2011/02/06
7:28 UTC
Read the original article
Hit count: 653
Hi,
I'm trying to download a file from a URL that looks like this:
http://pdf.example.com/filehandle.ashx?p1=ABC&p2=DEF.pdf
Within the browser, this link prompts me to download a file called x.pdf irrespective of what DEF is (but 'x.pdf' is the right content).
However using wget, I get the following:
>wget.exe http://pdf.example.com/filehandle.ashx?p1=ABC&p2=DEF.pdf
SYSTEM_WGETRC = c:/progra~1/wget/etc/wgetrc
syswgetrc = C:\Program Files\GnuWin32/etc/wgetrc
--2011-01-06 07:52:05-- http://pdf.example.com/filehandle.ashx?p1=ABC
Resolving pdf.example.com... 99.99.99.99
Connecting to pdf.example.com|99.99.99.99|:80... connected.
HTTP request sent, awaiting response... 500 Internal Server Error
2011-01-06 07:52:08 ERROR 500: Internal Server Error.
'p2' is not recognized as an internal or external command,
operable program or batch file.
This is on a Windows Vista system
Edit1
>wget.exe "http://pdf.example.com/filehandle.ashx?p1=ABC&p2=DEF.pdf"
SYSTEM_WGETRC = c:/progra~1/wget/etc/wgetrc
syswgetrc = C:\Program Files\GnuWin32/etc/wgetrc
--2011-02-06 10:18:31-- http://pdf.example.com/filehandle.ashx?p1=ABC&p2=DEF.pdf
Resolving pdf.example.com... 99.99.99.99
Connecting to pdf.example.com|99.99.99.99|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 4568 (4.5K) [image/JPEG]
Saving to: `filehandle.ashx@p1=ABC&p2=DEF.pdf'
100%[======================================>] 4,568 --.-K/s in 0.1s
2011-02-06 10:18:33 (30.0 KB/s) - `filehandle.ashx@p1=ABC&p2=DEF.pdf'
saved [4568/4568]
© Super User or respective owner