You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, i have the situation that i have zip in zip ... an cannot figure out how to unpack all of them recursively.
maybe someone can point me to the problem here:
constrecursiveUnZip=async(folder: string,zipfiles: string[])=>{returnawaitPromise.allSettled(zipfiles.map(zipFile=>newPromise<string>((resolve,reject)=>{constresolveFunc=resolveconstrejectFunc=rejectconstzip=newStreamZip({storeEntries: true,file: `${folder}/${zipFile.replace(//g,' ')}`,})zip.on('error',function(err){console.error('[ERROR]',err)})zip.on('ready',function(){console.log('All entries read: '+zip.entriesCount)})zip.on('entry',function(entry){constpathname=path.resolve(`./${folder}`,entry.name)if(/\.\./.test(path.relative(`./${folder}`,pathname))){console.warn('[zip warn]: ignoring maliciously crafted paths in zip file:',entry.name)return}if('/'===entry.name[entry.name.length-1]){console.log('[DIR]',entry.name)return}zip.extract(entry,`${folder}/${entry.name}`,async(err?: string,res?: number|undefined)=>{console.log('DEBUG zip file entry name',entry.name)if(path.parse(entry.name).ext.includes('zip')){console.log('DEBUUG',path.parse(entry.name).base)awaitrecursiveUnZip(folder,[path.parse(entry.name).base])}if(err){rejectFunc(`error: ${err}`)}else{}})})zip.close(()=>resolveFunc('done'))})))}
any help would be great!
The text was updated successfully, but these errors were encountered:
Hi, i have the situation that i have zip in zip ... an cannot figure out how to unpack all of them recursively.
maybe someone can point me to the problem here:
any help would be great!
The text was updated successfully, but these errors were encountered: