views:

262

answers:

1

I am currently working on importing contacts from windows live contacts(hotmail addressbook). At one stage, the service posts back some data that i need to my page as a base64 encoded string which, as per microsoft documentation, contains url escaped sequences for '&' and '='. The string is thus not standard base64 encoded. The problem is when I try to convert it back to the original string from coldfusion, coldfusion refuses to recognize this as a valid base64 encoded string. How can I obtain the original string?

string looks something like this: "eact%253D28grLAdrSYSMp6mYbAozFuDqlgk78UZZ%25252F5A%25252Bygx.... (pretty long)" My cfmethod to convert back is simple - tostring(tobinary("ENCODED STRING"))// Thanks to Ben nadel The error obtained is "parameter 1 of tobinary which is is not base64 encoded"

Please help...

+5  A: 

Can't you URLDecode() it first then you should have a base64 string?

http://livedocs.adobe.com/coldfusion/6.1/htmldocs/funca113.htm

Greg K