ng-file-select does not work when request fails

Issue I am using angular-file-upload in my angular project. https://github.com/danialfarid/angular-file-upload <span ng-file-select=”onFileSelect($files)” class=”btn btn-primary btn-lg” role=”button”>Upload employee list</span> Its working fine for first uplaod but when the upload fails, afterwards it does not work. Please suggest any workaround. Thanks in

Continue reading

AngularJS error: $apply already in progress

Issue I have this AngularJS 1.0.7 code that is using angular-file-upload plugin to upload photos: HTML: <div ng-hide=”user.mainPhoto” style=”margin-top: 20px”> <center> <div ng-controller=”FileUploadCtrl”> <button class=”btn btn-success btn-primary” ng-click=”clickFileInput(‘addMainPhoto’)”><i class=”fa-icon-picture” style=”vertical-align: middle”></i> {{‘ADD_PROFILE_PHOTO’ | translate}}</button> </div> </center> <input id=”addMainPhoto” type=”file” ng-file-select=”onFileSelect($files,

Continue reading

sending additional values to PHP script using angular-file-upload

Issue So i am using angular-file-upload For this i need the following controller: app.controller(‘FileUploadCtrl’, [‘$scope’, ‘FileUploader’, function($scope, FileUploader) { var uploader = $scope.uploader = new FileUploader({ url: ‘js/controllers/upload.php’, }); // FILTERS uploader.filters.push({ name: ‘customFilter’, fn: function(item /*{File|FileLikeObject}*/, options) { return

Continue reading

Lib angular file upload with field data object json

Issue I’m using lib angular-file-upload. How do I add the date field of $http request on request below: var app = angular.module(‘app’, [‘angularFileUpload’]); app.controller(‘Aula21Controller’, function($scope, FileUploader){ var uploader = $scope.uploader = new FileUploader({ url : ‘http://localhost:8080/work/v1/chats’, alias: ‘message-body’, headers: {‘X-Client-Instance’:

Continue reading

Angularjs $injector:modulerr

Issue ng-fileupload having injection error on angular 1.2.3 my source code attached here <!DOCTYPE html> <html ng-app =”dashboard”> <head> <title></title> <script src=”angular.min.js”></script> <script src=”angular-ui-router.js”></script> </head> <body> <div class=”box-content”> <form ng-controller=”mycontroller as up” name=”up.upload_form”> <table cellspacing=”10″ cellpadding=”10″ style=”margin-left: 5%; cellspacing= 7;”>

Continue reading

angularjs angular-file-upload Unknown provider: $uploadProvider error

Issue This is not a duplicate of This Question I have included all the required files in view: <script src=”~/Scripts/angular-file-upload-master/examples/console-sham.min.js”></script> <script src=”~/Content/js/angular.js”></script> <script src=”~/Scripts/angular-file-upload-master/angular-file-upload.js”></script> My module and controller: var controllers = angular.module(‘controllers’, [‘ngGrid’, ‘ngDialog’, ‘angularFileUpload’]); controllers.controller(‘CustomProductsCtrl’, [‘$scope’, ‘$window’, ‘ngDialog’, ‘CommonService’,

Continue reading

How to upload file in php using angular js

Issue Now I am learning angular js with php. I will try to upload files and stored file name in mysql database task.html <!DOCTYPE html> <html> <script src=”js/shared/angular.min.js”></script> <body ng-app=”myApp” ng-controller=”myCtrl”> <div class=”file-upload”> <input type=”text” ng-model=”name”> <input type=”file” file-model=”myFile”/> <button

Continue reading

Video loading message until response comes from backend

Issue Video Upload.js var json = { “request”: { “service”:{ “servicetype”:servicetype, “session_id”: session_id }, “data”:{ “rolename”:rolename } } }; FileService.uploadFile( json, file ).then(function(res){ console.log(JSON.stringify(res)); if( res && res.status.code == 0 ) { $scope.getVideo( res.data.mediaids[0] ); $scope.getAll(); } else FlashService.Error(res.status.message, true);

Continue reading

How to give gif image for loading until response comes from backend

Issue HTML: <div class=”row” ng-if=”dataLoading” src=”data:image/gif;base64,R0lGODlhEAAQAPIAAP///wAAAMLCwkJCQgAAAGJiYoKCgpKSkiH/C05FVFNDQVBFMi4wAwEAAAAh/hpDcmVhdGVkIHdpdGggYWpheGxvYWQuaW5mbwAh+QQJCgAAACwAAAAAEAAQAAADMwi63P4wyklrE2MIOggZnAdOmGYJRbExwroUmcG2LmDEwnHQLVsYOd2mBzkYDAdKa+dIAAAh+QQJCgAAACwAAAAAEAAQAAADNAi63P5OjCEgG4QMu7DmikRxQlFUYDEZIGBMRVsaqHwctXXf7WEYB4Ag1xjihkMZsiUkKhIAIfkECQoAAAAsAAAAABAAEAAAAzYIujIjK8pByJDMlFYvBoVjHA70GU7xSUJhmKtwHPAKzLO9HMaoKwJZ7Rf8AYPDDzKpZBqfvwQAIfkECQoAAAAsAAAAABAAEAAAAzMIumIlK8oyhpHsnFZfhYumCYUhDAQxRIdhHBGqRoKw0R8DYlJd8z0fMDgsGo/IpHI5TAAAIfkECQoAAAAsAAAAABAAEAAAAzIIunInK0rnZBTwGPNMgQwmdsNgXGJUlIWEuR5oWUIpz8pAEAMe6TwfwyYsGo/IpFKSAAAh+QQJCgAAACwAAAAAEAAQAAADMwi6IMKQORfjdOe82p4wGccc4CEuQradylesojEMBgsUc2G7sDX3lQGBMLAJibufbSlKAAAh+QQJCgAAACwAAAAAEAAQAAADMgi63P7wCRHZnFVdmgHu2nFwlWCI3WGc3TSWhUFGxTAUkGCbtgENBMJAEJsxgMLWzpEAACH5BAkKAAAALAAAAAAQABAAAAMyCLrc/jDKSatlQtScKdceCAjDII7HcQ4EMTCpyrCuUBjCYRgHVtqlAiB1YhiCnlsRkAAAOwAAAAAAAAAAAA==” > <div class=”file-upload-wrapper”> <div class=”file-upload”> <img class=”file-image” ng-src=”{{imageSource}}” ng-if=”imageSource”/> <input type=”file” file-model=”image” name=”file” class=”file”/> </div> <div class=”file-upload-text”> Upload Picture</div> </div> <div class=”file-restriction-info”> Maximum 5 Images can be attached.<br/> File size below 10MB. File Format

Continue reading

angular-file-upload: additional properties/options to each file in a multi-file upload?

Issue I’m using nervgh’s angular-file-upload, https://github.com/nervgh/angular-file-upload/wiki/Module-API. Is there a way to use the angular-file-upload and allow additional properties to each file when doing a multi-file upload? I’m using their image sample to start out with: http://nervgh.github.io/pages/angular-file-upload/examples/image-preview/ Trying to add a

Continue reading

angular-file-upload update scope onCompleteItem

Issue So i have a value in my scope called $scope.selectedComponent Then i have the following uploader: var uploader = $scope.uploader = new FileUploader({ url: ‘user_resources/upload.php’, formData: [{module_id: $state.params.id, component: $scope.selectedComponent}] }); // FILTERS uploader.filters.push({ name: ‘customFilter’, fn: function(item /*{File|FileLikeObject}*/,

Continue reading

How do I 'unselect' a selected file?

Issue I’m using this to allow the user to select and upload a file: <input id=”fileInput” type=”file” ng-file-select=”onFileSelect($files)”> This correctly show: When user clicks ‘Upload’, I upload the file. When the user clicks ‘Remove’, how do I clear out the

Continue reading

AngularJS $http POST turn into GET

Issue I have a route Route::post(‘/updateLogo’, ‘CaptivePortalController@updateLogo’); Then I make a POST here $http({ method: ‘POST’, <—– I did a POST url: ‘/updateLogo’, headers: { ‘Content-Type’: undefined }, transformRequest: function (data) { console.log(“data coming into the transform is “, data);

Continue reading

Unknown provider: $uploadProvider <- $upload

Issue Anyone know why I’m getting Unknown provider on this Angular code ? I am using the Angular File Upload directive and are using this example : http://www.mono-software.com/blog/post/Mono/233/Async-upload-using-angular-file-upload-directive-and-net-WebAPI-service/ Just cannot seem to figure out why I’m getting this error… module.js

Continue reading

how to upload a file in Restangularjs using multipart/formdata

Issue my html code <form method=”post” enctype=”multipart/form-data” ng-controller=”commentCtrl” name=”form”> <a href=”” type=”file” class=”custom-height”><img src=”source/assets/images/icons/icofileattached.png” class=”attachmentpng-height” ngf-select=”uploadFiles($file)” ng-model=”files”/></a> <md-button type=”submit” class=”md-raised custom-submit-button” ng-click=”MakeComments()”> SUBMIT </md-button> </form> Thanks for your help Solution This piece of code worked for me…. $scope.uploadFiles = function(file)

Continue reading

angular Spring Boot File Upload Example

Issue I want to Upload File To Spring boot backend , How should I send Formdata as requestparam in postrequest, i tried following code angular service class code let headers=new HttpHeaders({ ‘Content-Type="multipart/form-data’ }) const formData:FormData=new FormData(); formdata.apend(‘file’,file); return this.http.post(uploaadfile,{params:{ file:formData,

Continue reading

Import excel in angular 7 and save into database using node js

Issue I have a page to uploaded excel <div class=”form-group”> <label>Select file to upload.</label> <input type=”file” class=”form-control” (change)=”onFileChange($event);”> </div> <button type=”button” (click)=”Upload()” class=”btn btn-success pull-right”><i class=”fa fa-save fa-fw”></i> Upload File</button> Below is my upload() function and onFileChange() in component.ts onFileChange(event)

Continue reading