File Upload using AngularJS

前端 未结 29 1996
野趣味
野趣味 2020-11-21 07:24

Here is my HTML form:

29条回答
  •  余生分开走
    2020-11-21 08:17

    UPLOAD FILES

    
    
    
            $scope.uploadResume = function () { 
                var f = document.getElementById('resume').files[0];
                $scope.selectedResumeName = f.name;
                $scope.selectedResumeType = f.type;
                r = new FileReader();
    
                r.onloadend = function (e) { 
                    $scope.data = e.target.result;
                }
    
                r.readAsDataURL(f);
    
            };
    

    DOWNLOAD FILES:

               download resume
    
    var app = angular.module("myApp", []);
    
                app.config(['$compileProvider', function ($compileProvider) {
                    $compileProvider.aHrefSanitizationWhitelist(/^\s*(https?|local|data|chrome-extension):/);
                    $compileProvider.imgSrcSanitizationWhitelist(/^\s*(https?|local|data|chrome-extension):/);
    
                }]);
    

提交回复
热议问题