ng-file-upload

Is it possible to detect when the camera is on/ready with getUserMedia?

南楼画角 提交于 2021-02-09 10:58:08
问题 I am successfully using webcam.js with an angular app to allow users to capture a picture of themselves. However I'm having a problem where some users are uploading blank - all white or all black photos. I suspect that some cameras start up more slowly than others which is allowing users to take pictures of themselves that are blank before the camera is really working. I would like to be able to detect when the camera is actually on and streaming so I could wait until then to make the Take

How to send Multiple FIles along with the form data in angularjs

冷暖自知 提交于 2020-01-27 08:47:19
问题 I am using ng-file-upload to select multiple files.But my requirement is that i want to attach those selected files as a file list into my Js object and send this object to server through REST.So far my data inserting part is working fine with out file list. REST Service Code Snippet @POST @Path("/manual") @Produces(MediaType.APPLICATION_JSON) public boolean insertResults(testVO testResult) { for(Object o:testVO.getFiles()){ //File access code goes here } } testVO.Java class private String

How to send Multiple FIles along with the form data in angularjs

孤者浪人 提交于 2020-01-27 08:46:52
问题 I am using ng-file-upload to select multiple files.But my requirement is that i want to attach those selected files as a file list into my Js object and send this object to server through REST.So far my data inserting part is working fine with out file list. REST Service Code Snippet @POST @Path("/manual") @Produces(MediaType.APPLICATION_JSON) public boolean insertResults(testVO testResult) { for(Object o:testVO.getFiles()){ //File access code goes here } } testVO.Java class private String

Cross Domain Image upload Angular+laravel

安稳与你 提交于 2020-01-03 07:19:14
问题 I have been struggling with image upload on server. I am using ngFileUpload on front end. But I always get "Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource" Angular Code for file Upload : var uploadFile = function (file) { if (file) { if (!file.$error) { Upload.upload({ url: baseUrl+'upload', file: file }).progress(function (evt) { var progressPercentage = parseInt(100.0 * evt.loaded / evt.total); /

Cross Domain Image upload Angular+laravel

梦想的初衷 提交于 2020-01-03 07:19:06
问题 I have been struggling with image upload on server. I am using ngFileUpload on front end. But I always get "Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource" Angular Code for file Upload : var uploadFile = function (file) { if (file) { if (!file.$error) { Upload.upload({ url: baseUrl+'upload', file: file }).progress(function (evt) { var progressPercentage = parseInt(100.0 * evt.loaded / evt.total); /

PUT to S3 with presigned url gives 403 error

不打扰是莪最后的温柔 提交于 2020-01-02 01:56:28
问题 I'm using Node to get an presignedRUL for S3 in order to PUT an image to an S3 bucket. var aws = require('aws-sdk'); // Request presigned URL from S3 exports.S3presignedURL = function (req, res) { var s3 = new aws.S3(); var params = { Bucket: process.env.S3_BUCKET, Key: '123456', //TODO: creat unique S3 key //ACL:'public-read', ContentType: req.body['Content-Type'], //'image/jpg' }; s3.getSignedUrl('putObject', params, function(err, url) { if(err) console.log(err); res.json({url: url}); }); }

PUT to S3 with presigned url gives 403 error

时光毁灭记忆、已成空白 提交于 2020-01-02 01:56:21
问题 I'm using Node to get an presignedRUL for S3 in order to PUT an image to an S3 bucket. var aws = require('aws-sdk'); // Request presigned URL from S3 exports.S3presignedURL = function (req, res) { var s3 = new aws.S3(); var params = { Bucket: process.env.S3_BUCKET, Key: '123456', //TODO: creat unique S3 key //ACL:'public-read', ContentType: req.body['Content-Type'], //'image/jpg' }; s3.getSignedUrl('putObject', params, function(err, url) { if(err) console.log(err); res.json({url: url}); }); }

Scala Play Framework image upload with Angular ng-file-upload

本秂侑毒 提交于 2019-12-25 09:14:38
问题 I am using Angular ng-file-upload (https://github.com/danialfarid/ng-file-upload) on the frontend to manage the file upload process. Unfortunately, form contains a complex object with multiple files. Using the MultipartFormData (https://www.playframework.com/documentation/2.5.x/ScalaBodyParsers) on the server side I have successfully decomposed the uploaded content and can read it from the request.body . Now, to my surprise, I do not have a simple Json Objects but rather a strangely formed

Angular ng-file-upload delete

拈花ヽ惹草 提交于 2019-12-24 17:01:20
问题 Trying to figure best approach to be able to delete a file when using ng-file-upload. I got my list of files with a list. My html is: <div> <p>Files:</p> </div> <div> <ul> <li ng-repeat="f in files" style="font:smaller">{{f.name}} {{f.$error}} {{f.$errorParam}}</li> </ul> </div> In my controller, I have: $scope.$watch('files', function () { $scope.upload($scope.files); }); $scope.$watch('file', function () { if ($scope.file != null) { $scope.files = [$scope.file]; } }); $scope.log = '';

File upload with ng-file-upload throwing error

时间秒杀一切 提交于 2019-12-24 00:45:59
问题 I'm using ng-file-upload for uploading an image file. The code for html for the upload button is <button ng-disabled="croppedDataUrl===''" class="button button-3d button-rounded" ng-click="vm.upload(croppedDataUrl)">Upload</button> and the code for controller is as follows vm.upload = function(dataUrl) { Upload.upload({ url: AppConstants.api.images, data: { uploadedPicture: dataUrl, uploadedFrom: 'recipe' }, }).then(function(response) { $timeout(function() { $scope.result = response.data; });