Here is an example of an instance where a filename containing
%20 fails, but replacing the %20 with spaces, and enclosing in
quotes works.  At the end I find that just putting the original
URL (with %20) in quotation marks makes it work.  There is 
something else unusual about this URL.

The first command validates the version.
The second command is the desired URL/file and fails with %20
The third command repeats the second command with the -d switch.
The fourth command has %20 replaced with space and works.

Other files with %20 on different hosts/servers behave similarly.

Microsoft Windows 2000 [Version 5.00.2195]
(C) Copyright 1985-2000 Microsoft Corp.

C:\Documents and Settings\fholmes\Desktop\WGET-TEST>WGET -V
GNU Wget 1.9.1

Copyright (C) 2003 Free Software Foundation, Inc.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

Originally written by Hrvoje Niksic <[EMAIL PROTECTED]>.

C:\Documents and Settings\fholmes\Desktop\WGET-TEST>WGET http://hqinet001.hqmc.u
smc.mil/p&r/concepts/2004/PDF/CP%2004%20Chap%204%20pdfs/CP04%20CHAP%204%20Aviati
on%20Combat%20Element%20-%20pp186_SINGLE%20INTEGRATED%20AIR%20PICTURE.pdf
--10:13:38--  http://hqinet001.hqmc.usmc.mil/p
           => `p'
Resolving hqinet001.hqmc.usmc.mil... 192.156.19.119
Connecting to hqinet001.hqmc.usmc.mil[192.156.19.119]:80... connected.
HTTP request sent, awaiting response... 404 Object Not Found
10:13:38 ERROR 404: Object Not Found.

'r' is not recognized as an internal or external command,
operable program or batch file.

C:\Documents and Settings\fholmes\Desktop\WGET-TEST>WGET -d http://hqinet001.hqm
c.usmc.mil/p&r/concepts/2004/PDF/CP%2004%20Chap%204%20pdfs/CP04%20CHAP%204%20Avi
ation%20Combat%20Element%20-%20pp186_SINGLE%20INTEGRATED%20AIR%20PICTURE.pdf
DEBUG output created by Wget 1.9.1 on Windows.

set_sleep_mode(): mode 0x80000001, rc 0x80000000
--10:14:10--  http://hqinet001.hqmc.usmc.mil/p
           => `p'
Resolving hqinet001.hqmc.usmc.mil... seconds 0.00, 192.156.19.119
Caching hqinet001.hqmc.usmc.mil => 192.156.19.119
Connecting to hqinet001.hqmc.usmc.mil[192.156.19.119]:80... seconds 0.00, connec
ted.
Created socket 720.
Releasing 00894758 (new refcount 1).
---request begin---
GET /p HTTP/1.0
User-Agent: Wget/1.9.1
Host: hqinet001.hqmc.usmc.mil
Accept: */*
Connection: Keep-Alive

---request end---
HTTP request sent, awaiting response... HTTP/1.1 404 Object Not Found
Server: Microsoft-IIS/4.0
Date: Fri, 21 May 2004 14:19:44 GMT
Content-Length: 461
Content-Type: text/html


Closing fd 720
10:14:10 ERROR 404: Object Not Found.

'r' is not recognized as an internal or external command,
operable program or batch file.

C:\Documents and Settings\fholmes\Desktop\WGET-TEST>WGET -d "http://hqinet001.hq
mc.usmc.mil/p&r/concepts/2004/PDF/CP 04 Chap 4 pdfs/CP04 CHAP 4 Aviation Combat
Element - pp186_SINGLE INTEGRATED AIR PICTURE.pdf"
DEBUG output created by Wget 1.9.1 on Windows.

set_sleep_mode(): mode 0x80000001, rc 0x80000000
--10:15:54--  http://hqinet001.hqmc.usmc.mil/p&r/concepts/2004/PDF/CP%2004%20Cha
p%204%20pdfs/CP04%20CHAP%204%20Aviation%20Combat%20Element%20-%20pp186_SINGLE%20
INTEGRATED%20AIR%20PICTURE.pdf
           => `CP04 CHAP 4 Aviation Combat Element - pp186_SINGLE INTEGRATED AIR
 PICTURE.pdf'
Resolving hqinet001.hqmc.usmc.mil... seconds 0.00, 192.156.19.119
Caching hqinet001.hqmc.usmc.mil => 192.156.19.119
Connecting to hqinet001.hqmc.usmc.mil[192.156.19.119]:80... seconds 0.00, connec
ted.
Created socket 720.
Releasing 00895088 (new refcount 1).
---request begin---
GET /p&r/concepts/2004/PDF/CP%2004%20Chap%204%20pdfs/CP04%20CHAP%204%20Aviation%
20Combat%20Element%20-%20pp186_SINGLE%20INTEGRATED%20AIR%20PICTURE.pdf HTTP/1.0
User-Agent: Wget/1.9.1
Host: hqinet001.hqmc.usmc.mil
Accept: */*
Connection: Keep-Alive

---request end---
HTTP request sent, awaiting response... HTTP/1.1 200 OK
Server: Microsoft-IIS/4.0
Connection: keep-alive
Date: Fri, 21 May 2004 14:21:28 GMT
Content-Type: application/pdf
Accept-Ranges: bytes
Last-Modified: Wed, 10 Mar 2004 14:25:50 GMT
ETag: "dee42996ab6c41:3994"
Content-Length: 10971


Found hqinet001.hqmc.usmc.mil in host_name_addresses_map (00895088)
Registered fd 720 for persistent reuse.
Length: 10,971 [application/pdf]

100%[====================================>] 10,971        59.19K/s

10:15:54 (59.19 KB/s) - `CP04 CHAP 4 Aviation Combat Element - pp186_SINGLE INTE
GRATED AIR PICTURE.pdf' saved [10971/10971]


C:\Documents and Settings\fholmes\Desktop\WGET-TEST>

--------------------------------------------------

And now I have discovered that just putting quotation marks around the entire
URL makes it work, but it is "not found" on the first try and then it is
found when WGET automatically makes a second try with a little different syntax.
?????  See below.

Microsoft Windows 2000 [Version 5.00.2195]
(C) Copyright 1985-2000 Microsoft Corp.

C:\Documents and Settings\fholmes\Desktop\WGET-TEST>WGET "http://hqinet001.hqmc.
usmc.mil/p&r/concepts/2004/PDF/CP%2004%20Chap%204%20pdfs/CP04%20CHAP%204%20Aviat
ion%20Combat%20Element%20-%20pp186_SINGLE%20INTEGRATED%20AIR%20PICTURE.pdf"
--10:27:27--  http://hqinet001.hqmc.usmc.mil/p&r/concepts/2004/PDF/CP%2004%20Cha
p%204%20pdfs/CP04%20CHAP%204%20Aviation%20Combat%20Element%20-%20pp186_SINGLE%20
INTEGRATED%20AIR%20PICTURE.pdf
           => `CP04 CHAP 4 Aviation Combat Element - pp186_SINGLE INTEGRATED AIR
 PICTURE.pdf'
Resolving hqinet001.hqmc.usmc.mil... 192.156.19.119
Connecting to hqinet001.hqmc.usmc.mil[192.156.19.119]:80... failed: No such file
 or directory.
Retrying.

--10:27:48--  http://hqinet001.hqmc.usmc.mil/p&r/concepts/2004/PDF/CP%2004%20Cha
p%204%20pdfs/CP04%20CHAP%204%20Aviation%20Combat%20Element%20-%20pp186_SINGLE%20
INTEGRATED%20AIR%20PICTURE.pdf
  (try: 2) => `CP04 CHAP 4 Aviation Combat Element - pp186_SINGLE INTEGRATED AIR
 PICTURE.pdf'
Connecting to hqinet001.hqmc.usmc.mil[192.156.19.119]:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 10,971 [application/pdf]

100%[====================================>] 10,971        --.--K/s

10:27:48 (81.79 KB/s) - `CP04 CHAP 4 Aviation Combat Element - pp186_SINGLE INTE
GRATED AIR PICTURE.pdf' saved [10971/10971]


C:\Documents and Settings\fholmes\Desktop\WGET-TEST>

Reply via email to