Junaid Syed

Junaid Syed

  • 1.5k
  • 366
  • 45.3k

How can i save image in my project folder in angularjs.

Nov 22 2017 1:15 AM
Here is my HTML code:
  1. <div class="item form-group">  
  2.                            <label class="control-label col-md-3 col-sm-3 col-xs-12" for="Image">  
  3.                               Upload file  
  4.                            </label>  
  5.                            <div class="col-md-6 col-sm-6 col-xs-12">  
  6.                         <input type="file" id="img" name="img" ng-model="VendorsObject.Image" />  
  7.                            </div>  
  8.                        </div> 
  9. <button id="submit" type="submit" ng-disabled=formAddVendors.$invalid class="btn btn-success">{{VendorButton}}</button>
 onclick button the data should go to the below function
  1. $scope.manageVendors = function (vendorObject) {  
  2.             var createvendor = vendorObject;  
  3.             createvendor.UserName = globalValues.userName;  
  4.             var data = RMSService.insertVendors(globalValues.token, createvendor).then(function (response) {  
  5.                 $location.path("home/Vendors");  
  6.             }, function (error) {  
  7.                 console.log(error);  
  8.             })  
  9.         } 
 I can see all the data in vendorsObject in above code but iam not getting image is vendorObject.Please share your ideas.Help me thank you

Answers (2)