If you search this forum for "Base64" I'm sure you will find something including a function that will do the conversion or a pointer to a script that you can download that will do such conversions.
A few things you should understand about file uploads and the current client side api services available:
1. They will NOT retrieve the file from the users computer. That is up to you (the developer) to do. With browsers that support HTML5 file api, your are in luck: you can get the data of the user selected file, encode it to Base64 (if needed) and then use
the SP api service to send that data to SP and create the file.
2. I have not seen any examples of the file service being used on a list item attachment. Maybe it's possible, but all the exams I have seen were for documents in a document library.
Good luck. And post back if you find a solution to your use case.