AngularJs: How to check for changes in file input fields?

前端 未结 15 1382
傲寒
傲寒 2020-11-22 09:06

I am new to angular. I am trying to read the uploaded file path from HTML \'file\' field whenever a \'change\' happens on this field. If i use \'onChange\' it works but when

15条回答
  •  自闭症患者
    2020-11-22 09:41

    No binding support for File Upload control

    https://github.com/angular/angular.js/issues/1375

    instead of

     
    

    can you try

    
    

    Note: this requires the angular application to always be in debug mode. This will not work in production code if debug mode is disabled.

    and in your function changes instead of

    $scope.fileNameChanged = function() {
       alert("select file");
    }
    

    can you try

    $scope.fileNameChanged = function() {
      console.log("select file");
    }
    

    Below is one working example of file upload with drag drop file upload may be helpful http://jsfiddle.net/danielzen/utp7j/

    Angular File Upload Information

    URL for AngularJS File Upload in ASP.Net

    http://cgeers.com/2013/05/03/angularjs-file-upload/

    AngularJs native multi-file upload with progress with NodeJS

    http://jasonturim.wordpress.com/2013/09/12/angularjs-native-multi-file-upload-with-progress/

    ngUpload - An AngularJS Service for uploading files using iframe

    http://ngmodules.org/modules/ngUpload

提交回复
热议问题