bug-wget
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-wget] Bug?


From: Dale R. Worley
Subject: Re: [Bug-wget] Bug?
Date: Mon, 13 Nov 2017 21:19:14 -0500

<address@hidden> writes:
> I am running WGET from a command line but the server folder has a pound sign
> in the name. It looks like Wget cannot parse the folder name and truncates
> it at the # sign and so the files don't get downloaded. I have the folder
> path in quotes. Is anyone aware of this problem or know of a fix?
>
> "C:\Program Files (x86)\GnuWin32\bin\wget.exe" -m -nH -np
> "ftp://ftp.3gpp.org/tsg_cn/WG4_protocollars/TrFO_#01_stockholm/";

It's a subtle usage error.  The character '#' in URLs is a special
character, which is used to separate the "fragment identifier"
("01_stockholm/") from the main part of the URL.  What this means is
that one is expected to fetch the "resource" identified by the main URL
("ftp://ftp.3gpp.org/tsg_cn/WG4_protocollars/TrFO_";) and then look
within that resource to find the part identified by "01_stockholm/".
The only common use is with resources that are HTML files, where the
fragment identifier matches the "target" attribute of some "a" tag and
indicates the part of the HTML page that one should direct ones
attention to.

In the case of FTP URLs, if the name of one of the folders contains a
'#' character, it has to be coded in the URL as a "percent-escape", in
this case, '%23':

ftp://ftp.3gpp.org/tsg_cn/WG4_protocollars/TrFO_%2301_stockholm/

I'm running on Linux, not Windows, but if I execute

wget 'ftp://ftp.3gpp.org/tsg_cn/WG4_protocollars/TrFO_%2301_stockholm/'

I go get a directory listing of that folder.

See RFC 1738 section 3.2 for the details.

Dale



reply via email to

[Prev in Thread] Current Thread [Next in Thread]