uploadz
v0.0.8
Published
Angular NPM Package to upload files using multiple observer design patterns
Downloads
9
Maintainers
Readme
Uploadz
Angular NPM Package to upload files using multiple observer design patterns.
Table of contents
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',
}
UploadRequest
Model
type UploadRequest = {
url: string;
file: File;
};
Progress
Model
type Progress = {
percentage: number;
uploaded: number;
totalSize: number;
estimateTime: string;
};