135
rated 0 times
[
136]
[
1]
/ answers: 1 / hits: 31397
/ 11 Years ago, wed, october 16, 2013, 12:00:00
I'm trying to set up a form to be submitted using an ajax request to an api that has already been built using Ajax. For some reason the file just doesn't want to transfer to the system although there is already a back end built to handle this, and it works fine.
My service looks like this based on a tutorial I found here: http://badwing.com/multipart-form-data-ajax-uploads-with-angularjs/
addActivity: function(url){
return $http({
method: 'POST',
url: REQUEST_URL + 'Volunteering/AddActivity?token=' + token + url,
headers: {
'Content-Type': 'multipart/form-data'
},
data: {
file: $scope.file
},
transformRequest: formDataObject
}).
then(function(result) {
console.log(result);
return result.data;
});
},
I have a feeling it's just something really minor that i'm missing, can anyone offer some help?
More From » ajax