yarn add @masvio/uploader
Refer to the MASV API Developer Documentation.
Below is an example using the Portals
feature
- Login or Signup at MASV
- Follow the Documentation on Uploading to Masv
- Create a Package
OR
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);
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: '',
});
}
});
uploader.addFiles(...files);
For more detailed information. Visit the MASV Web Uploader documentation page