Hi all, I need to upload file and I use $http (this code is get from my 
.service() function):

sendFile: function (params) {
            return $http({method : 'post',
                url : 'http://XXXXXXXXXXXXX/rest/file.json',
                headers : { 'X-CSRF-Token' : $cookies['csrftoken']},
                data : params
            })
        },

Now, for little file and a good line there is no problem, but with a big file 
and/or a bad line there is a problem of UI: user can not know when upload will 
be end. I need a progress bar.
So I have search on internet, but I have not found a solution. Is there a 
possibility to get some progress/notification from $http ? 

I have tried this code without luck:
        
        ProfileService.sendFile(data)
                        .then(function(ret) {
                                var uri = ret.data.uri;
                                scope.content = "Upload finished";

                                scope.postForm.fid = ret.data.fid;
                                scope.postForm.buttonDisabled = false;
                            },
                            function(error) {
                                scope.postForm.showError = true;
                                scope.postForm.errorMsg = error.data;
                            },
                            function(progress) {
                                console.log("inside progress");
                                console.log(progress)
                            }
                        );

"progress" function is never called. 

Thanks.

--
Davide Morelli
[email protected]




-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to