Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8733223
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T09:36:26+00:00 2026-06-13T09:36:26+00:00

Does there exist a good file uploader with good integration (a directive) for AngularJS?

  • 0

Does there exist a good file uploader with good integration (a directive) for AngularJS?

I am looking for something that is easy to style and supports HTML5 drag and drop etc.

Someone will probably say that its easy to use an existing uploader and integrate it into AngularJS – to that I’ll say: if its easy then someone should have done it already.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T09:36:28+00:00Added an answer on June 13, 2026 at 9:36 am

    I actually have rolled my own uploader once… but only because I didn’t like any of the already made JQuery ones. Unfortunately that’s proprietary and I can’t post it on the internet… but… I can show you how to use just about any JQuery plugin from Angular:

    Someone will probably say that its easy to use an existing uploader and integrate it into AngularJS – to that i’ll say: if its easy then someone should have done it already.

    Let’s presume I have a jQuery plugin that works by selecting a div and calling pluginUploadCall() on it…

    app.directive('myJqueryPluginUploader', function() {
       return {
          restrict: 'A',
          link: function(scope, elem, attr, ctrl) {
              // elem is a jQuery lite object
              // or a jQuery object if jQuery is present.
              // so call whatever plugins you have.
              elem.pluginUploadCall();
          }
       };
    });
    

    And here’s how it would be used.

    <div my-jquery-plugin-uploader></div>
    

    Angular actually integrates really well with jQuery so any plugins that work in jQuery should work pretty easily in Angular. The only trickiness comes in when you want to keep Dependency Injection alive so you can keep your Angular App testable. JQuery isn’t very good at DI, so you may have to jump through some hoops.

    If you wanted to roll your own, I can tell you I did something like this:

    app.directive('customUploader', function(){
        return {
           restrict: 'E',
           scope: {},
           template: '<div class="custom-uploader-container">Drop Files Here<input type="file" class="custom-uploader-input"/><button ng-click="upload()" ng-disabled="notReady">Upload</button></div>',
           controller: function($scope, $customUploaderService) {
              $scope.notReady = true;
              $scope.upload = function() {
                 //scope.files is set in the linking function below.
                 $customUploaderService.beginUpload($scope.files);
              };
              $customUploaderService.onUploadProgress = function(progress) {
                 //do something here.
              };
              $customUploaderService.onComplete = function(result) {
                 // do something here.
              };
           },
           link: function(scope, elem, attr, ctrl) {
              fileInput = elem.find('input[type="file"]');
              fileInput.bind('change', function(e) {               
                   scope.notReady = e.target.files.length > 0;
                   scope.files = [];
                   for(var i = 0; i < e.target.files.length; i++) {
                       //set files in the scope
                       var file = e.target.files[i];
                       scope.files.push({ name: file.name, type: file.type, size: file.size });
                   }
              });
           }
    });
    

    Where $customUploaderService would be a custom service you create with Module.factory() that uses $http to post the files and check the progress on the server.

    I know that’s vague, and I’m sorry that’s all I can provide, but I hope that helps.

    EDIT: The drag and drop file upload is a bit of a trick of CSS, BTW… for Chrome and FF, what you do is put the in a containing div… then do something like this:

    <div class="uploadContainer">Drop Files Here<input type="file"/></div>
    
    div.uploadContainer {
       position: relative;
       width: 600px;
       height: 100px;
    }
    
    div.uploadContainer input[type=file] {
       visibility: hidden;
       position: absolute;
       top: 0;
       bottom: 0;
       left: 0;
       right: 0;
    }
    

    … now anything you drop on that div will really be dropped on the file upload, and you can make the div look like whatever you want.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does there exist a free Windows software program that will help you generate regular
There are always the log showing: file does not exist c:/wamp/www/favicon.ico in apache error_log.
Does there exist a utf8 code for x(4), functional for cross browser/os. According to
for ($rank=0; $rank<100; $rank++) { printf(Your rank: %d%s, $rank, $suffix); } Does there exist
I need to check if I Filesystem exists, and if it does exist there
There is the same question listed under The key 'UserID' does not exist in
There does not appear to be any good software to mount an FTP to
I've seen a few examples on file upload from WP7 - there a good
Possible Duplicate: Version control for VBA file Does any kind of version control exist?
I need to create a file if it does not exist, in a way

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.