@masvio/uploader
TypeScript icon, indicating that this package has built-in type declarations

2.2.0 • Public • Published

MASV Web Uploader

Installation

yarn add @masvio/uploader

Usage

First Steps

Getting set up with MASV

Refer to the MASV API Developer Documentation. Below is an example using the Portals feature

  1. Login or Signup at MASV
  2. Follow the Documentation on Uploading to Masv
  3. Create a Package

OR

Uploading Files

Instantiate the Uploader

Get a Package ID - id - and an Access Token - access_token - from one of the above methods.

import { Uploader } from "@masvio/uploader";

const uploader = new Uploader(id, access_token);

Retrieve Files

An html input with the type attribute set to file will have a property titled files in the DOM

<input type="file" id="fileInput" />
const fileInput = document.getElementById("fileInput");
let files = [];

fileInput.addEventListener("input", (event) => {
    for (let file of fileInput.files) {
        files.push({
            id: 'test ID',
            file,
            path: '',
        });
    }
});

Upload files

uploader.addFiles(...files);

For more detailed information. Visit the MASV Web Uploader documentation page

Package Sidebar

Install

npm i @masvio/uploader

Homepage

massive.io/

Weekly Downloads

371

Version

2.2.0

License

SEE LICENSE IN LICENSE.md

Unpacked Size

65.2 kB

Total Files

8

Last publish

Collaborators

  • masv_curt
  • masvmajed