base64 Encode
I'm writing a small export plugin for Apple's Aperture. While the sample FTP plugin does the job mostly, I needed something a little more feature rich for a web image gallery we have.
I started off by adding a receipt file to go alongside the image which included all the meta data to help categorise the image on the website. This worked reasonably well, along with a cron job to read the receipts and move the files.
Considering I want to allow others to use this plugin and that each person would need a unique login, I decided to use a SOAP based solution to get around the problem. The one huge caveat was, I needed to send binary data. I'm not up to speed with the SOAP with Attachments protocol so the only real solution for me was to base64 encode the data. Cocoa and objective C do not have this as a buillt-in method but I found a solution.
I found a lovely set of category classes by Dave Dribin to add that functionality to NSData. His website is: http://www.dribin.org/dave/ and the link to the blog item on the encoder is: http://www.dribin.org/dave/blog/archives/2006/03/12/base64_cocoa/