Last active
January 4, 2016 03:59
-
-
Save victormejia/8565732 to your computer and use it in GitHub Desktop.
Send File in Angular
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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