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

Re: wput file



On Thu, Apr 23, 2009 at 10:12:28 +0200, Erik Xavior wrote:
> Hi
> I'm trying to put a file to an ftp site:
> 
> wput -v file.txt ftp://USER:PASSWORD@foo.com/public_html/pub/
> 
> file.txt is just a normal plain text file.
> 
> But it says:
> 
> parse-error in escaped character:  is not a hexadecimal character
> 
> and it doesn't uploads the file :S
> 
> what am I missing?

If you have a percent sign in PASSWORD then it will be interpreted as an
escape character that is to be followed by a two-digit hexadecimal
number that encodes one character (i.e. the next two characters have to
be members of the set [0-9a-fA-F]):

http://en.wikipedia.org/wiki/Percent-encoding

Try to encode all special characters in PASSWORD according to RFC 3986.

For example, if PASSWORD is ":secret%text@" then the encoded version is
"%3Asecret%25text%40". If you have the liburi-perl package installed
then you can use perl to do the conversion of all special characters
(see "man URI::Escape"):

$ perl -e 'use URI::Escape; $encoded = uri_escape(":secret%text@"); print "$encoded\n";'
%3Asecret%25text%40

-- 
Regards,            | http://users.icfo.es/Florian.Kulzer
          Florian   |


Reply to: