Skip to content

acaprojects/ngx-uploads

Repository files navigation

Angular 8+ Cloud Uploads Library

Travis npm version david-dm semantic-release

This project was generated with Angular CLI version 8.0.0.

To be used in conjuction with Comdominios.

Introduction

This project is an Angular library for handling secure direct to cloud uploads that are managed by the Condominios project. At CoTag Media we use it to handle all of our file ingestion as it:

Effectively this project takes blob or file objects in the browser and

  • Manages an upload queue with pause, resume and progress for each upload
  • Supports configuring individual upload parallelism and the number of simultaneous uploads
  • All files are hashed in webworkers before upload for data integrity
  • Communicates with Condominios to obtain signed requests for the uploads

Usage

  1. Optionally bootstrap MD5_WORKER_BASE - this allows you to customise the path of the MD5 worker
  2. Bootstrap the MD5Workers - these perform the hashing in webworkers and should only be instansitated once
  3. In the components you wish to perform uploads, inject your Http service and the MD5Workers
  4. Import UploadManager and the storage providers you wish to use Amazon, Google, Azure, OpenStack
  5. Add the providers to the upload manager: UploadManager.addProvider(Amazon);

You can now use the manager

this.manager = new UploadManager(http, '/uploads', workers);
this.manager.autoStart = true;

// ...

// Add files to the upload manager
// Files is an array of Blobs or Files -> https://developer.mozilla.org/en/docs/Web/API/File
this.manager.upload(files);

Development server

Run gulp serve for a dev server. Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files.

Build

Run gulp build to build the library. The build artifacts will be stored in the dist/library directory. Use the --prod flag for a production build.

Running unit tests

Run ng test to execute the unit tests via Karma.

Installation

You install the library from npm using npm install @acaprojects/ngx-uploads;

About

Direct to cloud upload library for Angular 7+

Resources

Stars

Watchers

Forks

Packages

No packages published