Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

UnZipFile.ExtractFiles

Extracts all files from current archive into a folder.

Component Version macOS Windows Linux Server iOS SDK
Compression 6.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes

Deprecated

This function was deprecated. Use Archive.Extraxct instead.

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

Parameters

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

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.

Deprecated due to missing unicode support. Please use Archive.Extraxct for new projects.

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

Blog Entries

This function checks for a license.

Created 16th January 2016, last changed 7th February 2023


UnZipFile.Close - UnZipFile.GlobalComment