curl-users
Re: how to handle the username has ":" character problem?
Date: Mon, 29 Nov 2010 11:34:24 -0800
On Mon, Nov 29, 2010 at 09:25:35AM -0800, Jun Yin wrote:
> in my test, I need to use user authentication and username has ":"
> character in it, so the command should be like:
>
> curl -v ftp://192.168.6.100:2121/test.txt --user
> test-local:123456:test-ftp_at_172.18.14.111":123456
>
> username is "test-local:123456:test-ftp_at_172.18.14.111" and password is 123456
>
> my problem is curl does not work this way and always take test-local
> as username.
>
> I tried "curl -v ftp://192.168.6.100:2121/test.txt --user
> "test-local\:123456\:test-ftp_at_172.18.14.111":123456" and other forms,
> no luck.
>
> Can anybody tell me if there is a workaround?
You should be able to URL-escape the user name and embed it in the URL, like
this:
ftp://test-local%3a123456%3atest-ftp%40172.18.14.111:123456@192.168.6.100:2121/test.txt
>>> Dan
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2010-11-29