Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search

[REBOL] Strange chars in password Re:

From: mailinglists:post at: 3-Sep-2000 3:01

Hi, Allen Kamp replied to this earlier this week, I'll repost (hope you don't mind, Allen? =)... Regards, Rachid ----- Original Message ----- From: <[reboldes--bigfoot--com]> To: <[list--rebol--com]> Sent: Wednesday, August 23, 2000 12:00 AM Subject: [REBOL] Strange chars in the password
> HI all, > > I need to connect to a FTP server but the password contains strange
chars like #"@" #"\" #"#"
> I tried to url-encode the password, but it does not work. > I'm sure it was already discussed but I cannot find it. > > thanx for advice > oldes >
Hi Oldes, This allows you to avoid that.. read [ scheme: 'ftp user: "user-name" pass: "password" host: "" path: "private/" target: "file.dat" ] So that you don't have to construct that all the time, you could do use the following code.. ;--------------- config: make object! [pass: "password" user: "username"] authenticate: func [ {Returns a filled scheme block complete with password} url [url!] {The url to parse} /local url-value url-obj ][ url-obj: make net-utils/url-parser [] set url-obj/vars none url-value: url parse/all url url-obj/url-rules ;---Return Url data set compose [ scheme: (to-lit-word url-obj/scheme) user: (config/user) pass: (config/pass) host: (url-obj/host) path: (url-obj/path) target: (url-obj/target) ] ] ;e.g usage ; read authenticate ; read authenticate ;------------------ Cheers, Allen K