Fixed uploading of attachments, the provided code was not properly reading attachments out of TouchDB