View Full Version : howto: binary data in http responses (base64?)

Nov 6, 2008, 03:46 PM
hi folks, i was wondering what do you usually use when you need to download binary stuff from an http server, together with some other data. for example when you make a request and expect to receive a few images in a response, and each image tagged with a caption and a date, for example. i was thinking of an xml response from the server, with the contents of the binary (image) file in a CDATA field, and base64-encoded. where can i find, and how can i use, a base64 decoder in cocoa? or, generally speaking, is there a better alternative than this. thanks.

Nov 7, 2008, 04:34 AM
AFAIK there are no built-in base64 methods in Cocoa, but there are plenty of public domain C implementations that would be straightforward to port (Objective-C is a strict superset of C).