Skip to content

devashishSarmah/uploadz

Repository files navigation

Uploadz

Angular NPM Package to upload files using multiple observer design patterns.

Table of contents

How to use

Install the package

npm i uploadz

Inject the UploadzService Injectable

import { UploadzService } from 'uploadz';

contructure(uploadzService: UploadzService) {}

Using the uploadFiles method specifying files to upload and the endpoint

Method Signature uploadFiles(files: File[], url: string): Observable<any>[];

For each UploadRequest, A prettified Response Gets returned

'Request has been made!' Response header has been received! File has been uploaded!
For each event type : progress
Response of type Progress gets returned

{
       percentage: 0,
       uploaded: 0,
       totalSize: 0,
       estimateTime: '0 Seconds',
 }

Models

UploadRequest Model

type UploadRequest = {
  url: string;
  file: File;
};

Progress Model

type Progress = {
  percentage: number;
  uploaded: number;
  totalSize: number;
  estimateTime: string;
};

About

An Angular library to upload files

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published