proposals
proposals copied to clipboard
Zip
Plugin Request
Since Capacitor team stated that in the future there should be no cordova plugins, I would like to see zip plugin that allows me to unzip files
Name: zip
Package: @capacitor-community/zip
Platform(s)
iOS / Android
Existing Solutions
https://github.com/MobileChromeApps/cordova-plugin-zip + @ionic-native/zip
Description
I use zip.unzip
method to unzip .zip files on the device.
I couldn't get https://github.com/MobileChromeApps/cordova-plugin-zip to work for my purposes. I fed it a zipped directory, and it would only unzip the first file but behave as if it were successful. It doesn't seem like the project has been maintained since 2016.
I've searched through and tried some of the existing capacitor zip packages on npm, but it seems like there's nothing that's actively maintained and that would work beyond Capacitor version 3. As far as I can tell, to unzip a zipped folder in a Capacitor application, your options are to:
- create your own plug-in
- use JSZip to read the contents of each file into memory and then write each file to the filesystem again
- downgrade your project to Capacitor version 2 or 3
I am looking to get unzipping working in my capacitor app, but am running into an error when it runs on the device...
NativescriptCapacitor/NativeScriptCapPlugin.swift:27: Fatal error: Unexpectedly found nil while unwrapping an Optional value.
For my app I use @zip.js/zip.js
and the @capacitor/filesystem
plugin. This works -- the use case I have is to download zip from S3 to local FS to provide offline use capability.
I have this working in iOS and the browser. I think android works, too.
🎉 I've just published a Capacitor Zip plugin: https://capawesome.io/plugins/zip/ Let me know if you are missing any features!