Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server (Not)   Client   Old   Guides   Examples
New in version: 6.2   6.3   6.4   6.5   7.0   7.1   7.2   7.3   7.4   7.5    Statistic  

UnZipFile.ExtractFiles

Extracts all files from current archive into a folder.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
Compression 6.0 Yes Yes Yes Yes Yes

MBS( "UnZipFile.ExtractFiles"; destFolder { ; ExtractWithoutPath; Overwrite } )

Parameters

Parameter Description Example value
destFolder The native path to the destination folder.
Please make sure this folder exists.
"/Users/cs/Desktop/test"
ExtractWithoutPath Optional
If 1, all files are put in one folder and no subfolders are created.
0
Overwrite Optional
Pass 1 to allow files to be overwritten.
Default is 0 to not overwrite.

Result

Returns OK or error.

Description

Extracts all files from current archive into a folder.
Please use UnZipFile.OpenContainer and UnZipFile.OpenFile to open the archive first.

This function does not restore file permissions or other metadata.
And it may not work with non ASCII characters.

If you need more control over files being extracted, stored or error checking, please check example database coming with plugin.

This function requires a native path. Use Path.FileMakerPathToNativePath to convert a FileMaker path to a native path if required. If you like to have the user choose the path, you can use FileDialog functions.
For Server be aware that server has limited permissions and may not be able to access all files on a computer.

Examples

Opens archive and expands files:

Set Variable [$r; Value:MBS( "UnZipFile.OpenFile"; "/Users/cs/Desktop/test.zip" )]
If [$r = "OK"]
    Set Variable [$r; Value:MBS( "UnZipFile.ExtractFiles"; "/Users/cs/Desktop/test"; 0 )]
    Set Variable [$r; Value:MBS( "UnZipFile.Close" )]
End If

Expand files on Windows:

Set Variable [$r; Value:MBS( "UnZipFile.OpenFile"; "C:\Users\Christian\Desktop\DebugView.zip" )]
If [$r = "OK"]
    Set Variable [$r; Value:MBS( "UnZipFile.ExtractFiles"; "C:\Users\Christian\Desktop\test"; 0 )]
    Set Variable [$r; Value:MBS( "UnZipFile.Close" )]
End If

See also


UnZipFile.Close   -   UnZipFile.GlobalComment

Feedback: Report problem or ask question.




Links
MBS Xojo tutorial videos