Skip to content

Instantly share code, notes, and snippets.

@claudiopetrini
Created April 15, 2016 13:17
Show Gist options
  • Save claudiopetrini/70aa6bb280e72875c61dca23b87897ad to your computer and use it in GitHub Desktop.
Save claudiopetrini/70aa6bb280e72875c61dca23b87897ad to your computer and use it in GitHub Desktop.
JQuery file upload on Stamplay
var url = 'https://appId.stamplayapp.com/api/cobject/v1/cobjectId';
var input = document.getElementById('file-upload');
var fd = new FormData();
fd.append( 'file', input.files[0] );
$.ajax({
method : 'POST'
url: url,
data: fd,
contentType: false,
processData: false,
success : function(response){
console.log(response);
},
error : function(err){
console.log(err.responseText);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment