android Ti.Util.base64encode returns object
Titanium.Utils.base64encode(str) returns an object, and not a string as expected. is this a bug or do i miss something?
thx, u.
4 Answers
-
some problem here! watsup?
-
I have the same problem….
-
It returns a Blob call
getText()
on it to get the String form. -
Thanks Don.
Seemes like this is been missin in the documentation (Blob) …I get an exception now:
var f = Ti.Filesystem.getFile("img/Logga.png"); var blob = f.read(); var base = Titanium.Utils.base64encode(blob.getText()); Ti.API.info(base);
return:
Terminating app due to uncaught exception 'org.tavlan.UtilsModule', reason: 'Invalid type passed to function. invalid type in -[UtilsModule convertToString:] (UtilsModule.m:31)'