HTML Form Data to CouchDB Document with Attachment

This post represents the first steps towards creating a web-enabled document repository. In other words, this is the initial test of a proof-of-concept. The goal of this initial step is to create a record in CouchDB and attach a document to it. For me, being new to NoSQL, this started out much harder than I thought it should be. With any luck, I can clear up some of my confusion that you might experience.