JavaScript global method: uncompressFile

This method expands a .zip file into a specified location.

Syntax

uncompressFile(file name, target directory);

Arguments

The following arguments are valid for this function:

Argument Data type Required Description
file name String Yes This argument specifies the path and file name of the .zip file to uncompress.
target directory String No This argument specifies the target directory. If not specified, the location of the .zip file is used.

Return values

True indicates that the file uncompressed successfully, and any other return value indicates failure.

Throws

None

Description

This method expands a .zip file into a specified location.

Example

This example unzips the upgtest.zip file to c:/test.

var rc = uncompressFile("c:/test/upgtest.zip");
if( rc == true )
{
  print("uncompress file with one file successfully");
  // this will unzip the file to C:/test/test
  rc = uncompressFile("c:/test/upgtest.zip", "c:/test/test");
}
else
{
print("Failed to uncompress file.");
}
if(rc == true)
{
  print("All tasks are finished.");
}