При нажатии на кнопку загрузки мой файл не загружается, даже не сохраняется в базе данных - PullRequest
0 голосов
/ 14 февраля 2019

Когда я нажимаю кнопку загрузки, она не нажимается

Я пытался на локальном сервере с помощью nodejs

uc.uploadFiles = function(){

            var userId = $cookies.get("empLoggedIn");

            angular.forEach(uc.files,function(file,i){
                var deferred = $q.defer();

                file.upload = Upload.upload({
                    url:'/upload',
                    data: {file:file,id: userId,description:file.description,keywords: file.keywords,filetype: file.filetype}
                });

                file.upload.then(function(resp){
                    console.log("Success");
                    Notification.success({message:file.name+' uploaded successfully.',positionY: 'bottom',positionX:'left'});
                    return deferred.resolve(resp);
                },function(error){
                    Notification.error({message: 'could not upload '+file.name,positionY: 'bottom',positionX:'left'});
                    return deferred.reject(error);
                });

                promises.push(deferred.promise);
            })

            $q.all(promises).then(function(resp){
                uc.files = [];
                $scope.show = true;
            },function(error){
                console.log(error);
            })
        }

Файл должен быть сохранен в базе данных и сообщение об успехедолжен отображаться

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...