我正在尝试从如下 URL 下载文件:
http://pdf.example.com/filehandle.ashx?p1=ABC&p2=DEF.pdf
在浏览器中,无论 DEF 是什么,此链接都会提示我下载一个名为 x.pdf 的文件(但“x.pdf”是正确的内容)。
但是使用 wget,我得到以下信息:
>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.
这是在 Windows Vista 系统上
編輯1
>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]
答案1
将地址放在引号中,即:
wget.exe "http://pdf.example.com/filehandle.ashx?p1=ABC&p2=DEF.pdf"