Skip to content
Upload attachments straight to a CouchDB database from PhoneGap
Objective-C JavaScript
Pull request Compare This branch is 4 commits ahead, 12 commits behind andrewgleave:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Enables a PhoneGap app to push binary attachments straight to a CouchDB database. Built with Phonegap 1.0.0 RC2

Installation + Usage

Drag the .h and .m into the Plugins folder through the XCode4 file browser. Choose Create groups for any added folders on the dialog.

Put this in yo HTMLz:

<script src="pg-plugin-couchdb-attachment-upload.js"></script>

add key: com.phonegap.CouchDBAttachmentUploader value: CouchDBAttachmentUploader to the Plugins section of PhoneGap.plist in your app's Supporting Files directory. {
    function() { 
    function(err) { 
      console.log('err! ' + err)
      "filePath": uri,
      "couchURI": '',
      "_id": "poo",
      "contentType": "image/jpeg",
      "httpMethod": "put",
      "attachmentName": "photo.jpg",
      "progress": function(bytes,total){
        console.log('progress: ' + (bytes/total) * 100 + 'PERCENT');
}, function(error) {
    console.log(error, null, "Camera Error");
}, {quality: 50,
    destinationType: Camera.DestinationType.FILE_URI,
Something went wrong with that request. Please try again.