Skip to content

Instantly share code, notes, and snippets.

@victormejia
Last active August 29, 2015 14:06
Show Gist options
  • Save victormejia/4ad44f1938002ef16081 to your computer and use it in GitHub Desktop.
Save victormejia/4ad44f1938002ef16081 to your computer and use it in GitHub Desktop.
function sendFile = function (el) {
scope.uploading = true;
var filename = $('#inputElement').val(),
fObj = el.files[0];
if (f == '') {
return false;
}
var fPart = filename.split('\\'),
origFilename = fPart[fPart.length - 1];
var fData = new FormData();
fData.append('file_Upload', file);
// send image
var req = {
url: your_path,
method: 'POST',
data: fData
}
// use $.ajax
$.ajax(req)
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment