Hi,
I am using ionic + react to build a app for a android. So in AWS s3 I have stored a zip file. I want to download that zip file and unzipped the content and stored that in Directory.Data which is external storage of android.
I am using capacitor v ^ 5. So which capacitor plugins should I use, what should be the procedure.
Let me know If more information is needed. I have just started with ionic, and have some experience in ReactJs.
You can use the Capacitor Filesystem and Capacitor Zip plugins for this purpose:
import { Filesystem, Directory } from '@capacitor/filesystem';
import { Zip } from '@capawesome-team/capacitor-zip';
const downloadFile = async () => {
await Filesystem.downloadfile({
path: 'file.zip',
url: 'https://example.tld/file.zip',
});
};
const unzip = async () => {
await Zip.unzip({
source: '[...]/file.zip',
destination: '[...]/file',
});
};
Thanks
Is capawesome-team/capacitor-zip is paid or open source ?
It’s currently available as Sponsorware. You can read more about it here: Insiders - Capawesome
Hi,
I am using downloadFile FileSystem to download the zip file, and the download zip is file is successful. I am looking for alternative to unzip the files in native android directory, since the capwesome plugin is paid. Are there any alternative to unzip files ?