{dialog.object}phoneGapUnzipFiles Method
Syntax
{dialog.object}.phoneGapUnzipFiles(explicitFilenameURI, filesystemSource, folderSource, zipFileName, fileSystemTarget, dirStructureTarget, onSuccess, onError, flagListUnzippedFiles)
Arguments
- explicitFilenameURIstring
the fully qualified URI for the source zip file. This is an alternative to specifying the filesystemSource, folderSource and zipFileName . If you specify the filesystemSource, folderSource and zipFileName then you can set the explicitFilenameURI to a blank value.
- filesystemSourcestring
the file system part (e.g. 'temp', 'saved' etc) where the zip file is located
- folderSourcestring
the folder where the zip file is located
- zipFileNamestring
the zip filename (e.g. zipfile1.zip)
- fileSystemTargetstring
the file system part where the files should be unzipped (e.g. 'temp', 'saved' etc.)
- dirStructureTargetstring
the directory structure in the target file system part where the files should be unzipped. If the directory structure does not exist, it will be created.
- onSuccessfunction
callback function if files are successfully unzipped. If flagListUnzippedFiles is true, the callback function can reference filesArray - an array of all of the files that where unzipped
- onErrorfunction
callback function if the unzip action fails
- flagListUnzippedFilesboolean
true or false. If true, the onSuccess function is called with an array of files that were unzipped. If false, the onSuccess function is not called with any arguments.
Description
Unzip files on a mobile device built with Cordova.
Discussion
The .phoneGapUnzipFiles() method can be used to unzip files in a Cordova application. The method includes arguments to specify the file system part and folder where the source zip file located, the file system part where you want the unzipped files to be placed and optionally can call the onSuccess callback function with an array that contains the files that were unzipped.