$('#' + id).trigger('click'); - this line causes an error ...
javascript,ruby-on-rails,ruby,angularjs,angular-file-upload
It looks like you are using the 'upload right away' pattern. Here is a complete example for future seekers: app/views/static-pages/index.html: <div ng-app='myApp'> <h1>StaticPages#index</h1> <p>Find me in: app/views/static_pages/index.html.erb</p> <hr> <div ng-controller="FileUploadCtrl"> <input type="file" ng-file-select="" ng-model='selectedFiles' ng-file-change="myUpload(selectedFiles)" ng-multiple="true"> </div> </div> app/assets/javascripts/main.js.coffee: @app =...
As $scope.files is array you need to set third argument of $watch function to 'true' $scope.$watch('files', function () { console.log($scope.files); $scope.upload($scope.files); }, true); please see working demo here http://plnkr.co/edit/lGjgTIeVZdgxcS2kaE7p?p=preview app.controller('MainCtrl', function($scope, $upload) { $scope.$watch('files', function() { $scope.upload($scope.files); }); $scope.upload = function(files) { if (files && files.length) { for (var i...
javascript,angularjs,angular-file-upload
make sure that the $scope is loaded in your controller: .controller('AppController', ['$scope', 'FileUploader', function($scope, FileUploader) { and after that you can update the value of the $scope.selectedComponent from anywhere in this controller. $scope.selectedComponent = "not uploaded"; uploader.onCompleteItem = function (fileItem, response, status, headers) { $scope.selectedComponent = "upload complete"; }; ...
javascript,ajax,angularjs,q,angular-file-upload
Closures within loops are tricky. Closing on the loop variable will always get the last value (e.g. see this question - and google it for more theory/details). What you want would be to call another function within the loop: for (var i = 0; i < files.length; i++) { var...
javascript,angularjs,angular-file-upload
You can simply achieve your goal by doing this accept=".txt" <input ui-jq="filestyle" type="file" nv-file-select="" accept=".txt" uploader="uploader" data-icon="false" data-classButton="btn btn-default" data-classInput="form-control inline v-middle input-s" multiple> more information...
asp.net,angularjs,webmethod,angular-file-upload
Figured it out. You cannot have Content-Type as multipart/form-data in webmethods. Instead created a HttpHandler to upload the file and everything works just fine.
javascript,asynchronous,callback,angular-file-upload
I never used async-waterfall, but if I had to do this I would use $q promises and when the resolve event is received, then you can call your desired function. Start here. Also, lookup for $q.all() - that's what will help you. Here's a $q.all() example with success event (when...
angularjs,file-upload,multipartform-data,angular-file-upload
OK, resume after reconnect was not multipart's merit it was browsers' smart behavior. Answer is here
javascript,html,css,angularjs,angular-file-upload
I solved this by wrapping the entire page content in the drop area. <html> <head>...</head> <body> <div id="dropArea" class="dropArea" ng-file-drop="onFileSelect($files)" ng-file-drag-over-class="fileAdded"> <div id="drop-content-container"> <div id="drop-content"> <img src="img/app/files-upload-dd.png"> <h1>Drop Files Here!</h1> </div> </div> <div class="page-content">...</div> </div> </body> </html> ...
javascript,angularjs,angular-file-upload
Just add the dependancy on angularFileUpload and be sure to reference the JS files in the correct order, and you should be good to go index.html <script src="angular-file-upload-shim.min.js"></script> <script src="angular.min.js"></script> <script src="angular-file-upload.min.js"></script> module.js angular.module('photoApp', ['ngRoute', 'angularFileUpload']); ...
javascript,angularjs,file-upload,angular-file-upload
After a longtime, here is how this would work. Using the notify callback for the promise solves the problem. As I had stated earlier, I had moved the file upload code (based on this rep enter link description here) into the angular services and I was not able to get...