1

I have this situation. Make a request to upload file with angular-upload-file:

var onBeforeUploadItem = function(item) {
item.formData.push({test:'test'});
        };

        var _emptyQueue = function(){
            $scope.uploader.clearQueue();
            $scope.uploader.formData = [];
        };

        var onAfterAddingAll = function(addedFileItems) {
            $scope.uploader.uploadAll();
        };

        var _initUploader = function(){

            $scope.uploader =  new FileUploader({
                url: (restServiceUrl),
                isHTML5 : true
            });
            $scope.uploader.onBeforeUploadItem = onBeforeUploadItem;
            $scope.uploader.onAfterAddingAll = onAfterAddingAll;

            _emptyQueue();
        };

The request contain the file but List items = upload.parseRequest(service.getHttpServletRequest()) is empty. Help me! :)

1 Answers1

0

Ng input file is not allowed for use ng-model.

Not every feature offered is available for all input types. Specifically, data binding and event handling via ng-model is unsupported for input[file].

Detail.

You can take file path and use with Jquery File Upload functions.

This will help you: File Upload using AngularJS

Community
  • 1
  • 1
hurricane
  • 6,521
  • 2
  • 34
  • 44