bug-wget
[Top][All Lists]
Advanced

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

Re: [Bug-wget] --post-file


From: Micah Cowan
Subject: Re: [Bug-wget] --post-file
Date: Thu, 27 Jan 2011 08:41:41 -0800
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.13) Gecko/20101208 Thunderbird/3.1.7

On 01/26/2011 08:01 AM, Kaplan, Murad wrote:
> Hello,
> I am using wget and I have a question about the -post-data option.
> Can I use it to POST data to another server. Like, can I use it so upload 
> .jpg or .DOC files?
> For example wget -post-file=file-1.jpg http://server.com/files

No, sorry. See recent versions of the manual (where this has been
clarified a little better than some of the preceding version).

       --post-file=file
           Use POST as the method for all HTTP requests and send
           the specified data in the request body.  --post-data
           sends string as data, whereas --post-file sends the
           contents of file.  Other than that, they work in
           exactly the same way. In particular, they both expect
           content of the form "key1=value1&key2=value2", with
           percent-encoding for special characters; the only
           difference is that one expects its content as a
           command-line paramter and the other accepts its content
           from a file. In particular, --post-file is not for
           transmitting files as form attachments: those must
           appear as "key=value" data (with appropriate percent-
           coding) just like everything else. Wget does not
           currently support "multipart/form-data" for
           transmitting POST data; only
           "application/x-www-form-urlencoded". Only one of
           --post-data and --post-file should be specified.


-- 
HTH,
Micah J. Cowan
http://micah.cowan.name/



reply via email to

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