Created
October 21, 2012 13:46
-
-
Save steve-ross/3927019 to your computer and use it in GitHub Desktop.
Upload a file in couchdb with jQuery
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('#upload_file').submit(function(e){ | |
e.preventDefault(); | |
var data = {}; | |
$("form :file").each(function() { | |
data[this.name] = this.value; // file inputs need special handling | |
}); | |
$(this).ajaxSubmit({ | |
url: database_url + '/' + $('#_id').val() , | |
dataType: 'json', | |
success: function(responseText, statusText, xhr, $form) { | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment