ng-file-upload

Files are corrupted when upload image files and .xlsx in ng file upload in AngularJs

一世执手 提交于 2019-12-12 01:52:56
问题 To upload files into server i used ng-file-upload.In there i send files as form multi part.Also can upload multiple files to server.So far it is working with text,xml and csv files.I am not sure if i did some mistake to enable other format as well like jpeg,png and .xlsx file format. Here is my front end code snippet. <div class="input input-file "><span class="button"><input name="files[]" ngf-select multiple accept="text/csv/xlsx/xls" ngf-pattern=".txt,.xml,.xls,.csv,.xlsx" ngf-max-height=

How to send selected file list when submit button click in AngularJs

泪湿孤枕 提交于 2019-12-11 13:41:24
问题 I am using ng-file-upload to send files to server.ng-file-upload worked perfectly with upload file one by one.I am using latest chrome browser. Sample code snippet jsfiddle in there files are uploaded to the server when files are selected in the file input.But what i want is that files (selected file array) should be uploaded only to the server when submit button is clicked along with other form data. Jersey REST service @POST @Path("/manual") @Consumes(MediaType.MULTIPART_FORM_DATA)

AngularJS ng-file-upload not working inside ng-repeat

僤鯓⒐⒋嵵緔 提交于 2019-12-11 04:24:20
问题 I have directive "notes" which is basically a notes widget that I can add on any page and just add a name and id to it to allow people adding notes to that item. The users should be able to upload files to their notes using ng-file-upload as well now but I struggle to get the $scope.files populated by the ng-file-upload directive. I'm pretty sure it is as usual something stupid with the scope but I can't figure it out. So any idea why $scope.files gets not populated when I select a file?

getting Error: Unexpected field when trying to upload multiple files

好久不见. 提交于 2019-12-10 17:45:52
问题 If I use the example in multer's readme, I can upload a single file without problems. However, when I use the same sample I cannot do so for multiple files. I tried using the regular Error: Unexpected field at makeError (/Users/mroker/node_projects/JWT_Auth_Basic/node_modules/multer/lib/make-error.js:12:13) at wrappedFileFilter (/Users/mroker/node_projects/JWT_Auth_Basic/node_modules/multer/index.js:39:19) at Busboy. (/Users/mroker/node_projects/JWT_Auth_Basic/node_modules/multer/lib/make

Using ng-file-upload with Rails carrierwave gem to upload multiple files

匆匆过客 提交于 2019-12-07 01:46:55
问题 I'm trying to combine ng-file-upload and carrierwave to upload multiple files, but the controller on server side receives only one file (the last item of the selected files). Client side (reference) html <button type="file" ng-model="files" ngf-select ngf-multiple="true">Upload</button> js var upload = function (files, content) { return Upload.upload({ url: 'MY_CONTROLLER_URL', file: files, // files is an array of multiple files fields: { 'MY_KEY': 'MY_CONTENT' } }).progress(function (evt) {

Ng-File-Upload to Save PDF Blob to Database

痴心易碎 提交于 2019-12-06 09:52:35
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="image/*" ngf-max-size="2MB" required ngf-model-invalid="errorFile"><br /> <img ngf-thumbnail="picFile"

ng-file-upload not uploading in Ionics

妖精的绣舞 提交于 2019-12-06 07:50:41
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', fields: {'username': 'juan'}, file: file }).progress(function (evt) { var progressPercentage = parseInt(100

Automate file upload using Selenium and ng-file-upload

一个人想着一个人 提交于 2019-12-05 07:28:43
问题 I have a project where I am uploading photos via ng-file-upload and I need to automate the upload process with selenium webdriver in Python. my HTML element looks like this: <element ngf-pattern="image/*" accept="image/*" ngf-max-size="10MB" ngf-max-height="1000" ngf-select="addPhoto($index, $file)"> ...</element> Uploading the element definitely works when doing it manually. But I cannot find a way to automate this using Selenium in Python. I have tried finding the element, then sending the

Automate file upload using Selenium and ng-file-upload

醉酒当歌 提交于 2019-12-03 20:47:17
I have a project where I am uploading photos via ng-file-upload and I need to automate the upload process with selenium webdriver in Python. my HTML element looks like this: <element ngf-pattern="image/*" accept="image/*" ngf-max-size="10MB" ngf-max-height="1000" ngf-select="addPhoto($index, $file)"> ...</element> Uploading the element definitely works when doing it manually. But I cannot find a way to automate this using Selenium in Python. I have tried finding the element, then sending the keys of the image's absolute path, but that just puts the absolute path in the browser's search field

Angularjs Show Image preview only if selected file is image

江枫思渺然 提交于 2019-12-01 06:44:54
Here is my AngularJS code to show image preview when user selects the file <form action="<?php echo $this->getFormAction();?>" id="contactproForm" method="post" ng-app="myApp" ng-controller="myCtrl" enctype="multipart/form-data"> <label for="file"><?php echo Mage::helper('contactpro')->__('Attachment') ?></label> <div class="input-box"> <input type="file" id="file" class="input-text" ngf-select ng-model="picFile" name="attachement" accept="image/png, image/jpeg, image/jpg, application/msword, application/vnd.ms-excel, application/pdf " /> </div> <label for="file"><?php echo Mage::helper(