0

i want to do something like this:

    //have the choose a pdf document from their local drive
    <html> 
        <input type="file" ng-model="theInputFile"/>
        <button ng-click="submit()"> Submit </button>
    </html>

    //pass the document to a c# function for parsing
    <script>
        $scope.submit = function(){
            $http.post('Home/GetVendorInfo', 
               { "c#Input": $scope.theInputFile})
            .success(function (response) {
               console.log("send successtul");
   });
    </script>
Cœur
  • 37,241
  • 25
  • 195
  • 267
sgov090
  • 11
  • 7

1 Answers1

0

You should have a controller and module,

var app = angular.module("app", []);
app.controller("uploadController", ["$scope",
  function($scope) {    
 $scope.submit = function(){
            $http.post('Home/GetVendorInfo', 
               { "c#Input": $scope.theInputFile})
     .success(function (response) {
     console.log("send succestul");
}
}
Sajeetharan
  • 216,225
  • 63
  • 350
  • 396