Skip to content

Instantly share code, notes, and snippets.

@premchandpl
Last active August 29, 2015 14:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save premchandpl/47bfcb24e1f2a8fac908 to your computer and use it in GitHub Desktop.
Save premchandpl/47bfcb24e1f2a8fac908 to your computer and use it in GitHub Desktop.
$(function () {
var fileCountCheck = 0;
$("#btnSubmit").click(function () {
var data = [];
var fileArray = [];
$("#attachFilesContainer input:file").each(function () {
if ($(this)[0].files[0]) {
fileArray.push({ "Attachment": $(this)[0].files[0] });
}
});
data.push({"FirstName": $("#txtFirstName").val().trim(), "LastName": $("#txtLastName").val().trim(), "Files": fileArray});
createItemWithAttachments("MyList", data).then(
function(){
alert('Item created with Multiple attachments');
},
function(sender, args){
console.log('Error occured' + args.get_message());
}
);
});
.....
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment