-1

When I type the following:

http://www.archlinux.org/packages/extra/x86_64/enca/download/ 

wget is downloading index.html instead of the correct file which is: enca-1.13-2-x86_64.pkg.tar.xz

When I use a windows machine and navigate to the same location, it correctly prompts me to download the tarball package.

toolshed
  • 237
  • 4
  • 15

2 Answers2

0

Hmm, uh, works for me! I'm using wget 1.11.4 on a CentOS5 box, fwiw.

If I do a a curl, I get:

$ curl -Iv http://www.archlinux.org/packages/extra/x86_64/enca/download/
* About to connect() to www.archlinux.org port 80
*   Trying 66.211.214.131... connected
* Connected to www.archlinux.org (66.211.214.131) port 80
> HEAD /packages/extra/x86_64/enca/download/ HTTP/1.1
> User-Agent: curl/7.15.5 (i686-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5
> Host: www.archlinux.org
> Accept: */*
>
< HTTP/1.1 302 FOUND
HTTP/1.1 302 FOUND
< Date: Sun, 04 Mar 2012 19:20:24 GMT
Date: Sun, 04 Mar 2012 19:20:24 GMT
< Server: Apache
Server: Apache
< Location: http://mirrors.kernel.org/archlinux/extra/os/x86_64/enca-1.13-2-x86_64.pkg.tar.xz
Location: http://mirrors.kernel.org/archlinux/extra/os/x86_64/enca-1.13-2-x86_64.pkg.tar.xz

So the redirection is correct, at least on the mirror I'm hitting.

cjc
  • 24,916
  • 3
  • 51
  • 70
0

Try instead:

wget --trust-server-names http://www.archlinux.org/packages/extra/x86_64/enca/download/

"--trust-server-names

If this is set to on, on a redirect the last component of the redirection URL will be used as the local file name. By default it is used the last component in the original URL."