Upload attachments straight to a CouchDB database from PhoneGap
Pull request Compare This branch is 12 commits behind andrewgleave:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
CouchDBAttachmentUploader.h
CouchDBAttachmentUploader.m
README.md
phonegap.plugin.couchdb-attachment-upload.js

README.md

CouchDbAttachmentUploader

Enables a PhoneGap app to push binary attachments straight to a CouchDB database

Usage

Put the .h and .m files of the plugin in your Xcode project and add the .js file to your www folder.

window.plugins.CouchDBAttachmentUploader.upload($('#id_camera_image').attr('src'),
    'http://127.0.0.1:5984/couchdb',
    doc.id,
    doc.rev,
    function() { 
        //success callback
    },
    function(error) {
        //failure callback
    },
    {contentType: 'image/jpeg',
    method: 'put',
    attachmentName: 'photo.jpg'});