title: CouchDB/Cradle How do I add images?
body: <p>So Basically I want to let the user have the option of uploading an image when they register. I have no idea where to start forever. I know that CouchDB supports attachments, but how exactly does that work with Cradle.</p>
  
  <p>I found the following code in Cradle's documentation</p>
  
  <pre><code>saveAttachment: function (/* id, [rev], attachmentName, contentType, dataOrStream */) {
  </code></pre>
  
  <p>So I know it can save attachments. How would I pass in the image then? I'm assuming that in the html, i have to use</p>
  
  <pre><code>form(action='/upload', enctype='multipart/form-data', method='post')
  input(type='file', name='upload')
  input(type='submit', value='Upload')
  </code></pre>
  
  <p>But where do I go from there? Wouldn't this step save the image on the server somewhere. Then do I somehow need to get the address of the image and pass that to cradle to save it as an attachment in the CouchDB database.</p>
  
  <p>Thanks in advance if you can help me out!</p>