$scope.uploadFiles = function() {
//debugger;
var request = {
method: 'POST',
url: 'http://localhost/upload/',
data: formdata,
headers: {
'Content-Type': undefined
}
};
// SEND THE FILES.
$http(request)
.success(function (d) {
alert(d);
})
.error(function() {
});
}
Ich bekomme in der Konsole Fenster wie XMLHttpRequest kann http://localhost/upload/ nicht geladen werden. Kein 'Access-Control-Allow-Origin'-Header ist auf der angeforderten Ressource vorhanden. Origin 'http://localhost:55555' ist daher nicht erlaubt. Die Antwort hatte HTTP-Statuscode 405.Ich kann meine Dateien nicht mit angularjs hochladen?
Mögliche Duplikate von [AngularJS angular-Datei-Upload kann keine Daten in WebAPI 2 CORS hochladen] (http://stackoverflow.com/questions/28142643/angularjs-angular-file-upload-cannot-upload-data-to- webapi-2-cors) – fracz