Answer the question
In order to leave comments, you need to log in
Is it possible and how to extend the XMLHttpRequest constructor?
Hello!
Found that the AngularUI team has implemented a file upload plugin - ui.upload . The plugin is definitely good, but in the body it uses the usual XMLHttpRequest instead of $http. It's not too bad, but there are problems with the Django REST Framework, because in this case, setting the CSTFToken at the application start stage has no effect:
Application.run(['$http', '$cookies', function($http, $cookies) {
var token = $cookies.csrftoken;
$http.defaults.headers.common['X-CSRFToken'] = token;
$http.defaults.headers.post['X-CSRFToken'] = token;
}]);
Answer the question
In order to leave comments, you need to log in
The most normal apploader on angular.
https://github.com/danialfarid/ng-file-upload
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question