angular-file-upload

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

 ̄綄美尐妖づ 提交于 2020-01-16 05:47:40
问题 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 this.queue.length < 10; } }); // CALLBACKS uploader.onWhenAddingFileFailed = function(item /*{File|FileLikeObject}*/,

how to upload a file on form submit using web api and angular

为君一笑 提交于 2019-12-25 03:07:57
问题 I want to upload a file on form submit, its not posting on Web API. I want to save file in a local physical path using Web API. I am getting this error. POST http://localhost:35257/api/Employee/Create 500 (Internal Server Error). Html : <form [formGroup]="employeeForm" (ngSubmit)="save()" #formDir="ngForm" novalidate style="position:relative;"> <div> <input class="form-control" type="text" formControlName="Name"> <input type="file" id="FileUploader" (change)="onFileChange($event)" #fileInput

trigger file upload event

别说谁变了你拦得住时间么 提交于 2019-12-24 02:37:09
问题 I am unable to trigger file upload related event called onFileSelect when I select the file to upload. Here is my code. <head> <script src="~/Scripts/angular.min.js"></script> <script src="~/Scripts/angular-file-upload.min.js"></script> <script src="~/App/Main.js"></script> .... </head> <body data-ng-app="app"> .... </body> Inside Main.js var app = angular.module('app', ['angularFileUpload']); app.controller('fileCtrl', ['$scope', function ($scope, $http, $timeout, $upload) { $scope.mydata =

Split a big file to be upload using angular

岁酱吖の 提交于 2019-12-23 20:49:31
问题 I have to split a big file into 2mb parts to be sended into a server but i could not find any way. on angular or javascript. Right now i am using angularFileUpload to get it and send it as a big file. if anyone have a clue please let me know 回答1: You have to use the HTML5 file API. More info about it you can find here. I can't provide any code example, mainly because i don't know how your server looks. You have to give the user a transaction token, and he will have to send you the chunk

Nervgh Angular File Upload - How do I restrict the file formats to say jpeg and png?

情到浓时终转凉″ 提交于 2019-12-23 12:53:48
问题 I am upgrading an application that is using nv-file-select directive. I am unsure as to how to restrict the file formats supported for upload. 回答1: You want to use the filters as described in the documentation. Create the filter: var uploader = $scope.uploader = new FileUploader({ url: '/api/users/photo' }); // FILTERS uploader.filters.push({ name: 'imageFilter', fn: function(item /*{File|FileLikeObject}*/, options) { var type = '|' + item.type.slice(item.type.lastIndexOf('/') + 1) + '|';

File drag and drop functionality in Angular js/MVC not working

徘徊边缘 提交于 2019-12-12 04:37:57
问题 I am trying to implement a simple file drag and drop functionality in Angular js/MVC. I created a directive for the drag and drop. (function (angular, undefined) { 'use strict'; angular.module('fileupload', []) .directive("myDirective", function ($parse) { return { restrict: 'A', link: fileDropzoneLink }; function fileDropzoneLink(scope, element, attrs) { element.bind('dragover', processDragOverOrEnter); element.bind('dragenter', processDragOverOrEnter); element.bind('dragend', endDragOver);

how to upload a file in Restangularjs using multipart/formdata

我的梦境 提交于 2019-12-10 23:54:28
问题 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 回答1: This piece of code worked for me.... $scope.uploadFiles =

Unknown provider: $uploadProvider <- $upload

℡╲_俬逩灬. 提交于 2019-12-10 18:38:50
问题 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 file : angular.module('photoApp', ['ngRoute']); scripts.js file : // configure our routes angular.module('photoApp').config(function ($routeProvider) {

AngularJS how to send multipart/mixed

柔情痞子 提交于 2019-12-09 21:26:48
问题 I am working on a project where I have to upload a small bit of JSON with a file, working in AngularJS. I've written code using Danial Farid's angular-file-upload, and it is working, except, it always sends "multipart/form-data, boundary=<whatever>" However, I MUST use multipart/mixed. This is my call: $scope.upload = $upload.upload({ url: <my url>, method: 'POST', data: $scope.data, file: file, }).progress(function(evt) { console.log('percent: ' + parseInt(100.0 * evt.loaded / evt.total)); }

Angular : Unable to upload file using web API

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-08 05:22:41
问题 I want to upload a file on form submit, but its not posting on web API. And save file in a local physical path using Web API. Here I am trying to send file using FormData and trying to access the same in api call using HttpContext.Current.Request.Files but its giving 0 count. Html : <form [formGroup]="employeeForm" (ngSubmit)="save()" #formDir="ngForm" novalidate style="position:relative;" enctype="multipart/form-data"> <div> <input class="form-control" type="text" formControlName="Name">