Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Overview

Array<FileInfo> Files.UnZip(id: string)

...

Array<FileInfo> FilesmyFiles.UnZip(id: string, directorySeparatorseparator: string)

Arguments

string id
Id of file
string id
of file
string directorySeparator
directory separator in file names

Remarks

It saves the extracted files individually into database.

Example

...

Code Block
languagejs
var unzippedFiles = $Files.UnZip(zipFile.Id);
unzippedFiles.forEach(function(file) {
    var fileContent = $Files.GetString(file.Id);
    // do sth with the file content
});

// It would be a good practice to delete the archive file when you are finished using it
// since the files in it are also saved by calling the UnZip method
$Files.Delete(zipFile.Id);

...

separator
Directory separator. Optional. Default value is "\".

Remarks

This function is used to extract contents of an archive file.

It saves the extracted files individually into database.

Example

Usage

Code Block
languagejs
var unzippedFiles = $Files.UnZip(zipFile.Id);
unzippedFiles.forEach(function(file) {
    var fileContent = $Files.GetString(file.Id);
    // do sth with the file content
});

// It would be a good practice to delete the archive file when you are finished using it
// since the files in it are also saved by calling the UnZip method
$Files.Delete(zipFile.Id);

Examples

...

languagejs

...

See Also