Skip to content
Browse files

addAttachmentToDoc now respects contentType parameter

  • Loading branch information...
1 parent 208eb05 commit 54c427e5bc9cbabf50f55fd8c27f928f9b37a612 Nathan committed Oct 4, 2009
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/couchdb/database.js
View
3 lib/couchdb/database.js
@@ -44,6 +44,7 @@ Database.prototype = {
data: JSON.stringify(doc),
async: false,
success: function(data, statusText){
+ doc._id = data.id;
doc._rev = data.rev;
if (settings.success instanceof Function) {
settings.success(doc);
@@ -225,7 +226,7 @@ Database.prototype = {
var uri = this.uri() + doc._id + "/" + attachmentName + "?rev=" + doc._rev;
this.httpClient.put(uri, {
- headers: [ { "label" : "Content-Type", "value": "text/jpeg" }],
+ headers: [ { "label" : "Content-Type", "value": contentType }],
data: attachmentData.toArray(),
binary: true,
async: false,

0 comments on commit 54c427e

Please sign in to comment.
Something went wrong with that request. Please try again.