Class Storage#unzipFile
storage
- Defined in: storage.js
| Constructor Attributes | Constructor Name and Description |
|---|---|
|
Storage#unzipFile(successCallback, errorCallback, options)
Unzip file.
|
Class Detail
Storage#unzipFile(successCallback, errorCallback, options)
Unzip file. It should be compressed in PKI-ZIP format.
function unzipFile() {
var successCb = function (){
console.log("Unzip File successful");
};
var failureCb = function(cbObject){
var errorCode = cbObject.errorCode;
var errorText = cbObject.errorText;
console.log( " Error Code [" + errorCode + "]: " + errorText);
};
var options = {
zipPath: 'file://internal/myFile.zip',
targetPath: 'file://internal/unzip/to/here',
};
var storage = new Storage();
storage.unzipFile(successCb, failureCb, options);
}
- Parameters:
- {Function} successCallback
- success callback function.
- {Function} errorCallback
- failure callback function.
- {Object} options
Property Type Description Required zipPath Storage.SCAP_URI URI to the zip file (internal/usb/sdcard). required targetPath Storage.SCAP_URI URI to the target directory where the contents of the zip file will be stored. (internal/usb/sdcard) required
- Since:
- 1.2
- Returns:
After the method is successfully executed, successCallback is called without any parameter. If an error occurs, errorCallback is called with errorCode and errorText. To see how error codes are defined, check Error.ERROR_CODE