Open pranavkumar opened 10 years ago
var uploader = $scope.uploader = new FileUploader({
url: './api/mockups',
method: 'POST',
queue: [],
formData : [{x: $scope.x, b: $scope.b}]
});
uploader.onBeforeUploadItem = function(item) {
//if you want to change dynamically your url with item.url = ...
item.formData = [{x: $scope.x, b: $scope.b}];
console.log(item.formData);
};
use this instead:
item.formData.push({x: $scope.x});
@johnwesthoff where should item.formData.push({x: $scope.x}); be added should it be in the onBefore callback
@Sabonzy use onBeforeUploadItem callback:
imageUploader.onBeforeUploadItem = function (item) { item.formData = [{ value:'value' }]; }
what is the correct way of sending formData with individual file?