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>
0

1 Answer 1

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");
}
}
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.