React Native
React Native
Open and Unzip an AES Encrypted Zip
See more Zip Examples
Open and unzip an AES encrypted Zip.Chilkat React Native Downloads
import { Zip } from '@chilkat/react-native'
async function chilkatExample() {
// This example requires the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
const zip = new Zip();
try {
await zip.openZipAsync('/myZips/aes.zip');
} catch {
console.log(zip.lastErrorText);
return;
}
// Set the password needed to unzip.
// This password must match the password used when the zip
// was created.
zip.decryptPassword = 'myPassword';
// Unzip the .zip into /unzipDir.
// Returns the number of files and directories unzipped.
const unzipCount = await zip.unzipAsync('/unzipDir/');
if (unzipCount < 0) {
console.log(zip.lastErrorText);
} else {
console.log('Success!');
}
}