Skip to content

Instantly share code, notes, and snippets.

@victormejia
Last active January 4, 2016 03:59
Show Gist options
  • Save victormejia/8565732 to your computer and use it in GitHub Desktop.
Save victormejia/8565732 to your computer and use it in GitHub Desktop.
Send File in Angular
scope.sendFile = function (el) {
scope.uploading = true;
var f = $(el).val(),
fObj = el.files[0];
if (f == '') {
return false;
}
var fPart = f.split('\\'),
origFilename = fPart[fPart.length - 1];
var fData = new FormData();
fData.append('file_Upload', file);
var size = '60x60';
// send image
var req = {
url: path.getMarketplaceUrl('/adbroker/api/image/' + size),
method: 'POST',
data: fData
}
// use $http
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment