Skip to content

Instantly share code, notes, and snippets.

@DavidQL
Created February 13, 2013 23:56
Show Gist options
  • Save DavidQL/4949550 to your computer and use it in GitHub Desktop.
Save DavidQL/4949550 to your computer and use it in GitHub Desktop.
var formData = new FormData(),
$input = $('#avatar');
formData.append('user[avatar]', $input[0].files[0]);
$.ajax({
url: this.model.url(),
data: formData,
cache: false,
contentType: false,
processData: false,
type: 'PUT'
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment