node.js - how to unzip file and save into particaular folder -


i trying unzip zip file , save target path

i tried these thing

var zip = new admzip(x);

zip.extractallto(/target path,false);

and

fs.createreadstream(path/to/arch.zip).pipe(unzip.extract({ path: "targetpath"}));

it extracting zip file , save unzip file target path.it fine.

but if upload 2 zip file(it contain same name),it overwrite folder.

for example

first if upload image.zip ,it extracted , stored images(target folder) images folder contain image folder. again if upload image.zip,it extracted , overwrite image folder

so images folder contain again 1 image folder. if upload image1.zip file , images folder contain image , image1 folder.

so how save folder contain same name.


Comments

Popular posts from this blog

c# - Operator '==' incompatible with operand types 'Guid' and 'Guid' using DynamicExpression.ParseLambda<T, bool> -