ng-file-upload

TypeError: Upload.upload is not a function

 ̄綄美尐妖づ 提交于 2019-12-23 20:39:47
问题 I have this function, and it throw exception: $scope.uploadAvatar = function(avatar, user) { Upload.upload({ url: 'api/v1/user' + user.id + '/', avatar: avatar, method: 'put' }) }; TypeError: Upload.upload is not a function My scripts includes: <script src="/static/js/main.js"></script> <script src="/static/js/bootstrap.min.js"></script> <script src="/static/js/posts_controller.js"></script> <script src="/static/js/jquery.equalheights.min.js"></script> <script src="/static/js/video.js/video

AngularJS Upload a file and send it to a DB

心已入冬 提交于 2019-12-23 09:29:30
问题 I've been trying to get ngFileUpload working so that I can upload images and have them sent to a DB–in my case a mongoLab DB which accepts JSON objects that can be POST ed with a syntax like this: $http.post('myMongoName/myDb/myCollection/myTable', {'key': 'value'}) Fairly simple. However, I'm confused on how to send images uploaded using ngFileUpload to the DB. I'm using the familiar syntax introduced on ngFileUpload's documentation page: $scope.upload = function (files) { if (files && files

Ng-File-Upload to Save PDF Blob to Database

柔情痞子 提交于 2019-12-22 17:46:12
问题 I'm editing this post to show my latest attempt per suggestions below. I have been searching the forums trying to find a solution. I have an ASP.NET MVC Application in which I use Angular. I am trying to use danialfarid/ng-file-upload to allow users to upload PDFs which then get saved to the database as binary data (not my idea, but I have to do it that way). I have the following (taken from the examples) in my HTML: File:<input type="file" ngf-select ng-model="picFile" name="file" accept=

ng-file-upload not uploading in Ionics

℡╲_俬逩灬. 提交于 2019-12-22 11:19:33
问题 I am using ng-file-upload library for my Ionic mobile application and Im having challenges in implementing this library. I also used Codeigniter for my REST API. My upload request should have fields(some data) and the images. here is my code so far: $scope.doSubmitAttachment = function(){ console.log('@@@@@doSubmitAttachement- Process Request--' + $scope.images); $scope.upload($scope.images); }; $scope.upload = function (file) { Upload.upload({ url: 'http://192.168.8.247:130/api/upload',

Angular chaining promises from foreach loop

流过昼夜 提交于 2019-12-20 04:38:52
问题 I have an array of photo files that needed to upload to Azure Cloud Storage, and i using foreach loop to call upload as below: $scope.savetemplate = function () { var imagePathsArray = []; $scope.filesimage = []; $scope.filesimage.push($scope.file1); $scope.filesimage.push($scope.file2); $scope.filesimage.push($scope.file3); for (var i in $scope.filesimage) { $scope.upload($scope.filesimage[i]); } $scope.data.Images = imagePathsArray ; $http({ //after finish uploads i need to post the paths /

$http.post: Large files do not work

妖精的绣舞 提交于 2019-12-18 09:01:31
问题 I am trying to upload files through my web app using the following code. View: <form name="uploadForm" class="form-horizontal col-sm-12"> <div class="col-sm-4"> <input type="file" ng-model="rsdCtrl.viewData.file" name="file"/> </div> <div class="col-sm-4"> <button class="btn btn-success" type="submit" ng-click="uploadFile()">Upload</button> </div> </form> Controller: function uploadFile(){ if (uploadForm.file.$valid && file) { return uploadService.upload(vd.file, "Convictions Calculator",

Deselecting an upload file causes problems with files indexing in ng-file-upload

女生的网名这么多〃 提交于 2019-12-13 06:17:09
问题 The following html is used to select some images for upload <input type="file" id="files" ngf-select="select(files)" ng-model="files" name="file" accept="image/*" ngf-max-size="'2MB'" required ngf-multiple="true"> I am using the following html to display selected images as thumbnails with a button to cancel the selected file prior to uploading them. <div ng-repeat="f in files track by $index"> <div ng-show="f.type.indexOf('image') > -1"> <img ngf-src="f" class="thumb"> <button class= "btn btn

issue in uploading large files to aws s3 through browser using aws-sdk

柔情痞子 提交于 2019-12-13 06:17:00
问题 With the help of this blog http://www.cheynewallace.com/uploading-to-s3-with-angularjs/ I did manage to upload the files of smaller size (<30MB) to the s3 bucket. But while uploading a bit larger file (above 30MB) I am facing some issue. error:Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at 'https://s3.amazonaws.com/**' (Reason: CORS request failed). I am getting this error in the middle of file uploading i.e,initially it starts uploading ,but

How can I upload a file from AngularJS application to Firebase Hosting

↘锁芯ラ 提交于 2019-12-13 03:57:49
问题 I am using Firebase Hosting to host my AngularJS application. I am using ng-file-upload to grab the user-uploaded image from a form I already have in my application. I want to store the user-uploaded image in a folder on my Firebase Hosting. I cannot use Firebase Storage because I need a pre-determined, direct link to the image resource in various parts of my platform. I thought that maybe I could use Firebase Functions to upload the file and store it in my Firebase Hosting. I keep running

403 error on upload with ng-file-upload + acl: public-read (angular + firebase + Aws S3 app) acl:private uploads fine

Deadly 提交于 2019-12-12 21:45:28
问题 Scenario: blog feature for dev site (angular + firebase + Aws S3 + ng-file-upload) uploading images to S3 for storage and storing the url in firebase to be called when the blogpost is rendered Problem - 403 error Access Denied on upload- when acl in the request header is 'public-read' 'private' works - meaning they upload but don't render on the page (* but with manually changing image to make pubilic in Aws S3 bucket the image renders in the blog*) - going in circles to try to figure out