Bug 436822 - wget ignores '-P' when Content-Disposition set on server
wget ignores '-P' when Content-Disposition set on server
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: wget (Show other bugs)
i686 Linux
low Severity medium
: rc
: ---
Assigned To: Karsten Hopp
Depends On:
  Show dependency treegraph
Reported: 2008-03-10 13:34 EDT by Jari Takkala
Modified: 2016-03-22 09:18 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2009-09-02 05:38:46 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Jari Takkala 2008-03-10 13:34:59 EDT
Description of problem:
If the server returns the header Content-Disposition, and the -P argument is
supplied to wget, then wget will ignore the -P argument and store the file in
the current working directory.

Version-Release number of selected component (if applicable):
# rpm -q -i wget
Name        : wget                         Relocations: (not relocatable)
Version     : 1.10.2                            Vendor: Red Hat, Inc.
Release     : 7.el5                         Build Date: Tue 09 Jan 2007 11:12:03

# wget --version
GNU Wget 1.10.2 (Red Hat modified)

How reproducible:
Pass the '-P' argument and a directory path to wget. Also pass a URL for which
the server will reply with the Content-Disposition header.

Steps to Reproduce:
1. For example, create a directory /home/user/tmp and run a server on localhost
port 80 with netcat.
/home/user$ mkdir tmp
/root# nc -l -v 80

2. Connect to the server with wget and instruct it to store the downloaded file
in the tmp directory.
/home/user$ wget -P tmp

3. On the netcat server side, paste in content similar to below.

HTTP/1.1 200 OK
Date: Mon, 10 Mar 2008 14:57:36 GMT
Server: Apache/2.2.3 (CentOS)
X-Powered-By: PHP/5.1.6
Content-Disposition: attachment; filename=foobar
Content-Length: 10
Connection: close
Content-Type: application/gzip


Actual results:
The file is stored in the current working directory of wget (/home/user).

Expected results:
The file should be stored in the relative directory of tmp (/home/user/tmp).

Additional info:
This argument worked correctly on RHEL 4. If you omit the Content-Disposition
line, then the file is correctly stored in /home/user/tmp.
Comment 1 Phil Knirsch 2008-04-29 10:46:53 EDT
After talking with the developer about this bug i'm proposing it for RHEL-5.3
granting Devel ACK for it.

Read ya, Phil
Comment 7 errata-xmlrpc 2009-09-02 05:38:46 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.


Note You need to log in before you can comment on or make changes to this bug.