Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Saving a base64 encoded image

My application receives images that are base64 encoded and wrapped in XML. While I have no problem choosing and sending a picture, the decoded picture will not render and is always larger than the original. This seems to be because Titanium re-encodes the data into some other format and does not recognize a binary string decoded from base64. Has anyone found a way around this?

A quick summary of methods I have tried (only on droid for now):

  1. Just writing the decoded string
  2. Using JSON to stringify and parse around the base 64
  3. Converting the string to an object and saving the file
  4. Attempting to create a tiblob for the string prior to saving

Code illustrating error and current workaround methods can be found at: http://pastie.org/1082461

A trace log of the code execution can be found at: http://pastie.org/1082455

— asked August 9th 2010 by Gary Blosser
  • base64
  • file
  • media
  • mobile
0 Comments

0 Answers

The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.