2.0.1 • Published 4 years ago

nz-file-uploader v2.0.1

Weekly downloads
33
License
MIT
Repository
github
Last release
4 years ago

Angular FileUploader

This is an Angular plugin that supports uploading files to server as a multipart/form-data

Features

  • Upload files to your server by just providing the api url in the config
  • Configuration for file types and file sizes are allowed
  • custom messages on success and failure of file uploads
  • Supports multiple file uploads in one go
  • Supports Drag&Drop uploads
  • Provides the percentage of file uploaded to server
  • Shows progress of file uploads
  • Works with any server side platform that supports standard HTML multipart form uploads

Install

npm install nz-file-uploader --save

Setup

Step1 : Import FileUploadModule from the package nz-file-uploader in app.module.ts file.

import { FileUploadModule } from  'nz-file-uploader'

Step2 : Add the FileUploadModule in the NgModule Imports array.

FileUploadModule.forRoot()

Step3 : Add the tags <nz-file-uploader></nz-file-uploader> in the app.component.ts file.

Setting Global Options

Pass values to FileUploadModule.forRoot()

// root app NgModule
 imports: [
 FileUploadModule.forRoot({
     API:  'Your api url here', // The files are uploaded using your api url
     fileTypes: ['images/jpeg', 'images/png'],
     maxFileSize: '100', // in MB
     fileTypeMsg:  'Please select valid filetype',
     filesizeMsg:  'File is too large',
     uploadSuccessMsg: 'Successfully uploaded',
     uploadFailureMsg: 'Upload failed',
     removePlaceHolder: 'remove',
     uploadBtnLabel: 'Upload',
    }),
 ],

Options :

Following are the options and its defaults values

OptionsTypeDefaultRequired
APIStringemptyTrue
fileTypesArray'image/jpeg' 'image/png' 'video/mp4' 'application/zip'False
maxFileSizeString500 MBFalse
fileTypeMsgStringPlease select valid filetypeFalse
filesizeMsgStringFile is too largeFalse
uploadSuccessMsgStringSuccessfully uploadedFalse
uploadFailureMsgStringUpload failedFalse
removePlaceHolderStringremoveFalse
uploadBtnLabelStringUploadFalse

Description :

This package handels the angular UI to upload files to server using your own backend api. Just provide your api URL in the configuration in imports.

Don't forget to handel the uploads in "multipart/form-data" in your backend service.

Credits

Author && Developer : Nizamuddin shaik

Designer : Jaseem.p

License

Mit License: http://www.opensource.org/licenses/mit-license.php

2.0.1

4 years ago

2.0.0

4 years ago

1.5.11

4 years ago

1.4.11

4 years ago

1.4.10

4 years ago

1.3.10

4 years ago

1.2.10

4 years ago

1.1.10

4 years ago

1.0.0

4 years ago

0.2.1

4 years ago

0.3.1

4 years ago

0.1.1

4 years ago

0.0.1

4 years ago