-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Alex edited this page Jul 26, 2014
·
15 revisions
See this issue: #40
For example, in Ruby on Rails, add an additional header, and use this method for verifying XSRF:
var csrf_token = document.querySelector('meta[name="csrf-token"]').getAttribute('content');
var uploader = $scope.uploader = new FileUploader({
// your code here...
headers : {
'X-CSRF-TOKEN': csrf_token // X-CSRF-TOKEN is used for Ruby on Rails Tokens
},
//...
});
You can use uploader callback or item callback:
uploader.onBeforeUploadItem(function(item) {/* your code here */});
// or
item.onBeforeUpload(function() {/* your code here */});
Yes. See directives API.