send multiple image data with textbox from angular controller

后端 未结 1 948
春和景丽
春和景丽 2021-01-15 20:33

i want to send multiple image data with textbox value to server side(PHP).i have done multiple image upload but i am not able to send my data to server side when submitting

1条回答
  •  滥情空心
    2021-01-15 20:45

    you need to use the $http service to send images to the server

    $scope.save = function() {
        var fd = new FormData();
        fd.append('file', $scope.files);
        $http.post('uploadUrl', fd, {
                transformRequest: angular.identity,
                headers: {
                    'Content-Type': undefined
                }
            })
            .then(function(response) {})
            .catch(function(response) {});
    }
    

    0 讨论(0)
提交回复
热议问题