score:1

Accepted answer
const addUploadCapabilities = requestHandler => (type, resource, params) => {
    if (type === 'UPDATE' && resource === 'posts') {
       //use jszip to zip file here and package it however you need
       // call the API with zipped file
   } return requestHandler(type, resource, params);
};

score:3

let zip = require('jszip')();
//hoping you have already taken input
let input = document.getElementById('fileInput'); // fileInput is id of my input element
let file = input.files[0];
let allZip =  zip.file(file.name, file);
console.log(allZip)

Related Query

More Query from same tag