All Projects → kzrfaisal → Angular File Uploader

kzrfaisal / Angular File Uploader

Licence: mit
Angular file uploader is an Angular 2/4/5/6/7/8/9/10 + file uploader module with Real-Time Progress Bar, Responsive design, Angular Universal Compatibility, localization and multiple themes which includes Drag and Drop and much more.

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Angular File Uploader

Ngx Smart Modal
Modal/Dialog component crafted for Angular
Stars: ✭ 256 (+178.26%)
Mutual labels:  npm, npm-package, angular2, angular4, angular5, angular6
Uploadcare Widget
Uploadcare Widget, an ultimate tool for HTML5 file upload supporting multiple file upload, drag&drop, validation by file size/file extension/MIME file type, progress bar for file uploads, image preview.
Stars: ✭ 183 (+98.91%)
Mutual labels:  image, upload, file, file-upload, uploader
Ngx Papaparse
Papa Parse wrapper for Angular
Stars: ✭ 83 (-9.78%)
Mutual labels:  angular2, angular4, angular5, angular6
ngx-smart-loader
Smart loader handler to manage loaders everywhere in Angular apps.
Stars: ✭ 28 (-69.57%)
Mutual labels:  angular2, npm-package, angular4, angular5
ngx-img
No description or website provided.
Stars: ✭ 25 (-72.83%)
Mutual labels:  upload, angular4, angular5, angular6
angular-rollbar-source-maps
Angular 2+ implementation to upload sourcemaps to Rollbar
Stars: ✭ 17 (-81.52%)
Mutual labels:  angular2, angular4, angular5, angular6
angular-material-datatransfer
A HTML5 datatransfer UI for handling upload and download of multiple simultaneous files.
Stars: ✭ 13 (-85.87%)
Mutual labels:  angular2, upload, angular4, uploader
angular-progress-bar
This component allow you to easy incorporate progress-bar to angular/ionic project, providing binding and color options
Stars: ✭ 26 (-71.74%)
Mutual labels:  angular2, angular4, angular5, angular6
Ngx Monaco Editor
Monaco Editor component for Angular 2 and Above
Stars: ✭ 347 (+277.17%)
Mutual labels:  angular2, angular4, angular5, angular6
Angular Material App
基于最新Angular 9框架与Material 2技术的web中后台前端应用框架。
Stars: ✭ 509 (+453.26%)
Mutual labels:  angular2, angular4, angular5, angular6
Chibisafe
Blazing fast file uploader and awesome bunker written in node! 🚀
Stars: ✭ 657 (+614.13%)
Mutual labels:  upload, file, file-upload, uploader
ng-toggle
Bootstrap-styled Angular Toggle Component
Stars: ✭ 14 (-84.78%)
Mutual labels:  angular2, angular4, angular5, angular6
spring-websocket-angular6
Example for using Spring Websocket and Angular with Stomp Messaging
Stars: ✭ 18 (-80.43%)
Mutual labels:  angular2, angular4, angular5, angular6
Nebular
💥 Customizable Angular UI Library based on Eva Design System 🌚✨Dark Mode
Stars: ✭ 7,368 (+7908.7%)
Mutual labels:  angular2, angular4, angular5, angular6
file-input-accessor
Angular directive that provides file input functionality in Angular forms.
Stars: ✭ 32 (-65.22%)
Mutual labels:  file, angular4, angular5, angular6
AuthGuard
Example repo for guarding routes post
Stars: ✭ 42 (-54.35%)
Mutual labels:  angular2, angular4, angular5, angular6
Ngx File Drop
Angular 11 file and folder drop library
Stars: ✭ 220 (+139.13%)
Mutual labels:  upload, file-upload, angular2, angular4
Springbootangularhtml5
♨️ Spring Boot 2 + Angular 11 + HTML5 router mode + HTTP interceptor + Lazy loaded modules
Stars: ✭ 89 (-3.26%)
Mutual labels:  angular2, angular4, angular5, angular6
Ng Http Loader
🍡 Smart angular HTTP interceptor - Intercepts automagically HTTP requests and shows a spinkit spinner / loader / progress bar
Stars: ✭ 327 (+255.43%)
Mutual labels:  angular2, angular4, angular5, angular6
Angular Froala Wysiwyg
Angular 4, 5, 6, 7, 8 and 9 plugin for Froala WYSIWYG HTML Rich Text Editor.
Stars: ✭ 696 (+656.52%)
Mutual labels:  angular2, angular4, angular5, angular6

Angular file uploader is an Angular 2/4/5/6/7/8/9/10 + file uploader module with Real-Time Progress Bar, Responsive design, Angular Universal Compatibility, localization and multiple themes which includes Drag and Drop and much more.

Demo

https://kzrfaisal.github.io/#/afu

Install

npm i angular-file-uploader

Support

Support this package if it really helped you, send your support at Patreon.

Video Guide

Youtube | Angular File Uploader

Usage

  • Bootstrap.min.css is required. Include
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
    
    in your index.html.
  • Import AngularFileUploaderModule inside your app.module.ts
    import { AngularFileUploaderModule } from "angular-file-uploader";
    
    @NgModule({
      imports: [
          ...,
          AngularFileUploaderModule,
          ...
      ]
    })
    
Example-1 ( with minimal configuration )
<angular-file-uploader
      [config]="afuConfig">
</angular-file-uploader>
afuConfig = {
    uploadAPI: {
      url:"https://example-file-upload-api"
    }
};
Example-2 ( with all available configuration )
<angular-file-uploader 
      [config]="afuConfig"
      [resetUpload]=resetVar
      (ApiResponse)="DocUpload($event)">
</angular-file-uploader>
afuConfig = {
    multiple: false,
    formatsAllowed: ".jpg,.png",
    maxSize: "1",
    uploadAPI:  {
      url:"https://example-file-upload-api",
      method:"POST",
      headers: {
     "Content-Type" : "text/plain;charset=UTF-8",
     "Authorization" : `Bearer ${token}`
      },
      params: {
        'page': '1'
      },
      responseType: 'blob',
    },
    theme: "dragNDrop",
    hideProgressBar: true,
    hideResetBtn: true,
    hideSelectBtn: true,
    hideSelectBtn: true,
    fileNameIndex: true,
    replaceTexts: {
      selectFileBtn: 'Select Files',
      resetBtn: 'Reset',
      uploadBtn: 'Upload',
      dragNDropBox: 'Drag N Drop',
      attachPinBtn: 'Attach Files...',
      afterUploadMsg_success: 'Successfully Uploaded !',
      afterUploadMsg_error: 'Upload Failed !',
      sizeLimit: 'Size Limit'
    }
};
Properties Description Default Value
config : object It's a javascript object. Use this to add custom constraints to the module. All available key-value pairs are given in example 2.For detailed decription refer the table below. {}
ApiResponse:EventEmitter It will return the response it gets back from the uploadAPI. Assign one custom function ,for example " DocUpload($event) " here, where " $event " will contain the response from the api.
resetUpload : boolean Give it's value as " true " whenever you want to clear the list of uploads being displayed. It's better to assign one boolean variable ('resetVar' here)to it and then change that variable's value. Remember to change 'resetVar' value 'true' to 'false' after every reset. false
[config] Description Default Value
multiple : boolean Set it as " true " for uploading multiple files at a time and as " false " for single file at a time. false
formatsAllowed : string Specify the formats of file you want to upload. '.jpg,.png,.pdf,.docx, .txt,.gif,.jpeg'
maxSize : number Maximum size limit for files in MB. 20 MB
uploadAPI.url : string Complete api url to which you want to upload. undefined
uploadAPI.method : string HTTP method to use for upload. POST
uploadAPI.headers : {} Provide headers you need here. {}
theme : string Specify the theme name you want to apply. Available Themes: ' dragNDrop ', ' attachPin ' If no theme or wrong theme is specified, default theme will be used instead.
hideProgressBar:boolean Set it as " true " to hide the Progress bar. false
hideResetBtn:boolean Set it as " true " to hide the 'Reset' Button. false
hideSelectBtn:boolean Set it as " true " to hide the 'Select File' Button. false
fileNameIndex:boolean Set it as " false " to get the same file name as 'file' instead of 'file1', 'file2'.... in formdata object. true
replaceTexts:object Replace default texts with your own custom texts. refer to example-2

A Better Way to reset the module

You have seen that by using 'resetUpload' property, you can reset the module easily, however if you need to reset more than one time, there's a better way of doing that( bcoz in 'resetUpload' property, you have to make it as false in order to use it again):-

Example-3
<angular-file-uploader #fileUpload1
      [config]="afuConfig"
      [resetUpload]=resetVar
      (ApiResponse)="DocUpload($event)">
</angular-file-uploader>
  • Assign one local reference variable (here 'fileUpload1') to the component.
  • Now use this local reference variable in your xyz.component.ts file.
        @ViewChild('fileUpload1')
        private fileUpload1:  AngularFileUploaderComponent;
    
    • Remember to import ViewChild and AngularFileUploaderComponent properly in your component.
        import { ViewChild } from '@angular/core';
        import { AngularFileUploaderComponent } from "angular-file-uploader";
      
  • That's it.....all done, now just use
        this.fileUpload1.resetFileUpload();
    
    to reset the module hassle-free anytime.

Styling:

Following classes are available for customisation :
Include them in your global css class (src/styles.css)
Use '!important' if something doesn't works
  • .afu-select-btn {}
  • .afu-reset-btn {}
  • .afu-upload-btn {}
  • .afu-dragndrop-box {}
  • .afu-dragndrop-text {}
  • .afu-constraints-info {}
  • .afu-valid-file {}
  • .afu-invalid-file {}
  • .afu-progress-bar {}
  • .afu-upload-status {}
  • .afu-attach-pin {}

Points to note:

  • Files are uploaded in FormData format.

Coming Soon:

  • More themes.
  • More customization options.

For Versions < 6.x : Click Here !



For Versions < 5.x : Click Here !


For Versions =< 4.0.12 :

  • Replace AngularFileUploaderModule and AngularFileUploaderComponent with FileUploadModule and FileUploadComponent respectively.

For Versions < 2.x : Click Here !



For Versions < 6.x :

Angular file uploader is an Angular 2/4/5/6 file uploader module with Real-Time Progress Bar, Angular Universal Compatibility and multiple themes which includes Drag and Drop and much more.

Demo

https://kzrfaisal.github.io/#/afu

Install

npm i angular-file-uploader

Usage

  • Bootstrap.min.css is required. Include
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
    
    in your index.html.
  • Import AngularFileUploaderModule inside your app.module.ts
    import { AngularFileUploaderModule } from "angular-file-uploader";
    
    @NgModule({
      imports: [
          ...,
          AngularFileUploaderModule,
          ...
      ]
    })
    
Example-1 ( with minimal configuration )
<angular-file-uploader
      [config]="afuConfig">
</angular-file-uploader>
afuConfig = {
    uploadAPI: {
      url:"https://example-file-upload-api"
    }
};
Example-2 ( with all available configuration )
<angular-file-uploader 
      [config]="afuConfig"
      [resetUpload]=resetVar
      (ApiResponse)="DocUpload($event)">
</angular-file-uploader>
afuConfig = {
    multiple: false,
    formatsAllowed: ".jpg,.png",
    maxSize: "1",
    uploadAPI:  {
      url:"https://example-file-upload-api",
      method:"POST",
      headers: {
     "Content-Type" : "text/plain;charset=UTF-8",
     "Authorization" : `Bearer ${token}`
      }
    },
    theme: "dragNDrop",
    hideProgressBar: true,
    hideResetBtn: true,
    hideSelectBtn: true,
    replaceTexts: {
      selectFileBtn: 'Select Files',
      resetBtn: 'Reset',
      uploadBtn: 'Upload',
      dragNDropBox: 'Drag N Drop',
      attachPinBtn: 'Attach Files...',
      afterUploadMsg_success: 'Successfully Uploaded !',
      afterUploadMsg_error: 'Upload Failed !'
    };
};
Properties Description Default Value
config : object It's a javascript object. Use this to add custom constraints to the module. All available key-value pairs are given in example 2.For detailed decription refer the table below. {}
ApiResponse:EventEmitter It will return the response it gets back from the uploadAPI. Assign one custom function ,for example " DocUpload($event) " here, where " $event " will contain the response from the api.
resetUpload : boolean Give it's value as " true " whenever you want to clear the list of uploads being displayed. It's better to assign one boolean variable ('resetVar' here)to it and then change that variable's value. Remember to change 'resetVar' value 'true' to 'false' after every reset. false
[config] Description Default Value
multiple : boolean Set it as " true " for uploading multiple files at a time and as " false " for single file at a time. false
formatsAllowed : string Specify the formats of file you want to upload. '.jpg,.png,.pdf,.docx, .txt,.gif,.jpeg'
maxSize : number Maximum size limit for files in MB. 20 MB
uploadAPI.url : string Complete api url to which you want to upload. undefined
uploadAPI.method : string HTTP method to use for upload. POST
uploadAPI.headers : {} Provide headers you need here. {}
theme : string Specify the theme name you want to apply. Available Themes: ' dragNDrop ', ' attachPin ' If no theme or wrong theme is specified, default theme will be used instead.
hideProgressBar:boolean Set it as " true " to hide the Progress bar. false
hideResetBtn:boolean Set it as " true " to hide the 'Reset' Button. false
hideSelectBtn:boolean Set it as " true " to hide the 'Select File' Button. false
replaceTexts:object Replace default texts with your own custom texts. refer to example-2

A Better Way to reset the module

You have seen that by using 'resetUpload' property, you can reset the module easily, however if you need to reset more than one time, there's a better way of doing that( bcoz in 'resetUpload' property, you have to make it as false in order to use it again):-

Example-3
<angular-file-uploader #fileUpload1
      [config]="afuConfig"
      [resetUpload]=resetVar
      (ApiResponse)="DocUpload($event)">
</angular-file-uploader>
  • Assign one local reference variable (here 'fileUpload1') to the component.
  • Now use this local reference variable in your xyz.component.ts file.
        @ViewChild('fileUpload1')
        private fileUpload1:  AngularFileUploaderComponent;
    
    • Remember to import ViewChild and AngularFileUploaderComponent properly in your component.
        import { ViewChild } from '@angular/core';
        import { AngularFileUploaderComponent } from "angular-file-uploader";
      
  • That's it.....all done, now just use
        this.fileUpload1.resetFileUpload();
    
    to reset the module hassle-free anytime.

Styling:

Following classes are available for customisation :
Include them in your global css class (src/styles.css)
Use '!important' if something doesn't works
  • .afu-select-btn {}
  • .afu-reset-btn {}
  • .afu-upload-btn {}
  • .afu-dragndrop-box {}
  • .afu-dragndrop-text {}
  • .afu-constraints-info {}
  • .afu-valid-file {}
  • .afu-invalid-file {}
  • .afu-progress-bar {}
  • .afu-upload-status {}
  • .afu-attach-pin {}
Points to note:
  • Files are uploaded in FormData format.

Coming Soon:

  • More themes.
  • More customization options.


For Versions < 5.x :

Angular file uploader is an Angular 2/4/5/6 file uploader module with Real-Time Progress Bar, Angular Universal Compatibility and multiple themes which includes Drag and Drop and much more.

Demo

https://kzrfaisal.github.io/#/afu

Install

npm i angular-file-uploader

Usage

  • Bootstrap.min.css is required. Include
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
    
    in your index.html.
  • Import AngularFileUploaderModule inside your app.module.ts
    import { AngularFileUploaderModule } from "angular-file-uploader";
    
    @NgModule({
      imports: [
          ...,
          AngularFileUploaderModule,
          ...
      ]
    })
    
Example-1 ( with minimal configuration )
<angular-file-uploader
      [config]="afuConfig">
</angular-file-uploader>
afuConfig = {
    uploadAPI: {
      url:"https://example-file-upload-api"
    }
};
Example-2 ( with all available configuration )
<angular-file-uploader 
      [config]="afuConfig"
      [resetUpload]=resetVar
      (ApiResponse)="DocUpload($event)">
</angular-file-uploader>
afuConfig = {
    multiple: false,
    formatsAllowed: ".jpg,.png",
    maxSize: "1",
    uploadAPI:  {
      url:"https://example-file-upload-api",
      method:"POST",
      headers: {
     "Content-Type" : "text/plain;charset=UTF-8",
     "Authorization" : `Bearer ${token}`
      }
    },
    theme: "dragNDrop",
    hideProgressBar: true,
    hideResetBtn: true,
    hideSelectBtn: true
};
Properties Description Default Value
config : object It's a javascript object. Use this to add custom constraints to the module. All available key-value pairs are given in example 2.For detailed decription refer the table below. {}
ApiResponse:EventEmitter It will return the response it gets back from the uploadAPI. Assign one custom function ,for example " DocUpload($event) " here, where " $event " will contain the response from the api.
resetUpload : boolean Give it's value as " true " whenever you want to clear the list of uploads being displayed. It's better to assign one boolean variable ('resetVar' here)to it and then change that variable's value. Remember to change 'resetVar' value 'true' to 'false' after every reset. false
[config] Description Default Value
multiple : boolean Set it as " true " for uploading multiple files at a time and as " false " for single file at a time. false
formatsAllowed : string Specify the formats of file you want to upload. '.jpg,.png,.pdf,.docx, .txt,.gif,.jpeg'
maxSize : number Maximum size limit for files in MB. 20 MB
uploadAPI.url : string Complete api url to which you want to upload. undefined
uploadAPI.method : string HTTP method to use for upload. POST
uploadAPI.headers : {} Provide headers you need here. {}
theme : string Specify the theme name you want to apply. Available Themes: ' dragNDrop ', ' attachPin ' If no theme or wrong theme is specified, default theme will be used instead.
hideProgressBar:boolean Set it as " true " to hide the Progress bar. false
hideResetBtn:boolean Set it as " true " to hide the 'Reset' Button. false
hideSelectBtn:boolean Set it as " true " to hide the 'Select File' Button. false
attachPinText:string If you are 'attachPin' theme, then you can use it to set custom text. 'Attach supporting documents..'

A Better Way to reset the module

You have seen that by using 'resetUpload' property, you can reset the module easily, however if you need to reset more than one time, there's a better way of doing that( bcoz in 'resetUpload' property, you have to make it as false in order to use it again):-

Example-3
<angular-file-uploader #fileUpload1
      [config]="afuConfig"
      [resetUpload]=resetVar
      (ApiResponse)="DocUpload($event)">
</angular-file-uploader>
  • Assign one local reference variable (here 'fileUpload1') to the component.
  • Now use this local reference variable in your xyz.component.ts file.
        @ViewChild('fileUpload1')
        private fileUpload1:  AngularFileUploaderComponent;
    
    • Remember to import ViewChild and AngularFileUploaderComponent properly in your component.
        import { ViewChild } from '@angular/core';
        import { AngularFileUploaderComponent } from "angular-file-uploader";
      
  • That's it.....all done, now just use
        this.fileUpload1.resetFileUpload();
    
    to reset the module hassle-free anytime.

Styling:

Following classes are available for customisation :
Include them in your global css class (src/styles.css)
Use '!important' if something doesn't works
  • .afu-select-btn {}
  • .afu-reset-btn {}
  • .afu-upload-btn {}
  • .afu-dragndrop-box {}
  • .afu-dragndrop-text {}
  • .afu-constraints-info {}
  • .afu-valid-file {}
  • .afu-invalid-file {}
  • .afu-progress-bar {}
  • .afu-upload-status {}
  • .afu-attach-pin {}
Points to note:
  • Files are uploaded in FormData format.

Coming Soon:

  • More themes.
  • More customization options.


For Versions < 2.x :

Example-1
<angular-file-uploader
    [uploadAPI]="'https://example-file-upload-api'">
</angular-file-uploader>
Example-2
<angular-file-uploader 
    [multiple]="true" 
    [formatsAllowed]="'.jpg,.png'" 
    [maxSize]="5" 
    [uploadAPI]="'https://example-file-upload-api'"
    [resetUpload]=resetVar
    (ApiResponse)="DocUpload($event)"
    [hideProgressBar]="false">
</angular-file-uploader>
Properties Description Default Value
multiple : boolean Set it as " true " for uploading multiple files at a time and as " false " for single file at a time. false
formatsAllowed : string Specify the formats of file you want to upload. '.jpg,.png,.pdf,.docx, .txt,.gif,.jpeg'
maxSize : number Maximum size limit for files in MB. 20 MB
uploadAPI : string Complete api url to which you want to upload. undefined
ApiResponse:EventEmitter It will return the response it gets back from the uploadAPI. Assign one custom function ,for example " DocUpload($event) " here, where " $event " will contain the response from the api.
resetUpload : boolean Give it's value as " true " whenever you want to clear the list of uploads being displayed. It's better to assign one boolean variable ('resetVar' here)to it and then change that variable's value. Remember to change 'resetVar' value 'true' to 'false' after every reset. false
hideProgressBar : boolean Set it as " true " to hide the Progress bar. false

You have seen that by using 'resetUpload' property, you can reset the module easily, however if you need to reset more than one time, there's a better way of doing that( bcoz in 'resetUpload' property, you have to make it as false in order to use it again):-

Example-3
<angular-file-uploader #fileUpload1
    [multiple]="true" 
    [formatsAllowed]="'.jpg,.png'" 
    [maxSize]="5" 
    [uploadAPI]="'https://example-file-upload-api'"
    [resetUpload]=resetVar
    (ApiResponse)="DocUpload($event)"
    [hideProgressBar]="false">
</angular-file-uploader>
  • Assign one local reference variable (here 'fileUpload1') to the component.
  • Now use this local reference variable in your xyz.component.ts file.
        @ViewChild('fileUpload1')
        private fileUpload1:  FileUploadComponent;
    
    • Remember to import ViewChild and FileUploadComponent properly in your component.
        import { ViewChild } from '@angular/core';
        import { FileUploadComponent } from "angular-file-uploader";
      
  • That's it.....all done, now just use
        this.fileUpload1.resetFileUpload();
    
    to reset the module hassle-free anytime.
Points to note:
  • Files are uploaded in FormData format.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].