« Quarantine Properties… | Home | REAL Studio linker pr… »

CURL tip of the day

11 07 10 - 14:00 Normally we all put username and password in the URL for a download. It's simple and convenient. Like this:
"ftp://christian:123456@ftp.someserver.com/test/file.txt"
But what to do if the username or the password contains characters like "@" or ":"?

"ftp://christian@mbs:123456@ftp.someserver.com/test/file.txt"
this URL will fail to parse as CURL expects the server name after the first @.

The solution is to use the OptionUsername and OptionPassword properties for the name and password:
c.OptionUsername = "christian@mbs"
c.OptionPassword = "123456"
c.OptionURL = "ftp://ftp.someserver.com/test/file.txt"
I hope this helps you.
No comments

  
Remember personal info?

Emoticons / Textile

Comment moderation is enabled on this site. This means that your comment will not be visible on this site until it has been approved by an editor.



Notify:
Hide email:

Small print: All html tags except <b> and <i> will be removed from your comment. You can make links by just typing the url or mail-address.