Hi I want to create a zip file from some selected images. I can’t find the blob() method for wix-fetch response module … I was referring to the example at www. medium .com @joshmarinacci/ a-little-fun-with-zip-files-4058812abf92 . I am assuming it is discontinued , could I get some help here. Thanks.
export async function saveToZip ( filename , urls ) {
const zip = new JSZip ()
const catalog = zip . folder ( ‘myfoldername’ )
**for** ( let x = 0 ; x < urls . length ; x ++){
//urls.forEach((url)=> {
let url = 'https://static.wixstatic.com/media/' + urls [ x ]
const blobPromise = **await** fetch ( url ). then ( r => { return r . blob() }) // <====== Error line
catalog . file ( filename [ x ], blobPromise )
}
zip . generateAsync ({ type : "nodebuffer" })
. then ( blob => FileSaver . saveAs ( blob , "images" ))
. catch ( e => console . log ( e ));
}