Archive.Content
---------------

Lists content of archive as JSON.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [Archive](component_Archive.md) | [9.0](newinversion90.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "Archive.Content"; Archive { ; Passphrase; Options } ) 

**MBS**( **"Archive.Content";** /\* Lists content of archive as JSON. \*/  
**$Archive**; /\* Either container with archive or native file path.e.g. "C:\\test\\test.zip" \*/   
**$Passphrase**; /\* Optional; Password to use. \*/   
**$Options**) /\* Optional; The options to pass to reader.  
This is a comma-separated list of options. Option names can be prefixed with module name. \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| Archive | Either container with archive or native file path. | "C:\\test\\test.zip" |  |
| Passphrase | Password to use. |  | Optional |
| Options | The options to pass to reader.   This is a comma-separated list of options. Option names can be prefixed with module name. |  | Optional      Added in version **14.3**. |

### Result

Returns JSON or error.

### Description

Lists content of archive as JSON.  
JSON has an entry count for the file count, an entry format for the format type and an entry for files array.  
### Examples

Check archive content:

 Set Variable \[ $list ; Value: MBS ("Archive.Content"; If(IsEmpty($Path ); $Container ; $Path )) \]   
If \[ MBS ("IsError") \]   
 Show Custom Dialog \[ "Failed to read container" ; $list \]   
Else  
 Set Variable \[ $Content ; Value: MBS ("[JSON.Colorize](JSONColorize.md)"; $list ) \]   
End If  
Get content of encrypted archive:

 MBS ( "Archive.Content";   
"/Users/cs/Desktop/invoices-2019-02-12\_1924.zip"; /\* path to archive (or container) \*/  
"98234kjh245234" /\* password \*/)  
Get content of a test zip file:

 MBS ( "Archive.Content"; "/Users/cs/Desktop/test.zip" )  
<small>  
Example result:   
{ "count" : 1 , "format" : "ZIP 2.0 (deflation)" , "files" : \[ { "Encrypted" : 0 , "EncryptedMetaData" : 0 , "EncryptedData" : 0 , "GID" : 20 , "UID" : 501 , "NLink" : 0 , "Size" : 400 , "ModeString" : "-rw-r--r-- " , "Mode" : 33188 , "XAttrCount" : 0 , "Permissions" : "644" , "RDevice" : 0 , "FileType" : "file" , "GroupName" : "" , "UserName" : "" , "HardLink" : "" , "PathName" : "test.rtf" , "SourcePath" : "" , "SymLink" : "" , "Flags" : "" , "SymLinkType" : null, "AccessTime" : "14.06.2022 14:48:16" , "ModificationTime" : "14.06.2022 14:48:16" , "AttributeModificationTime" : "14.06.2022 14:48:16" } \] } </small>### See also

- [Archive.FileList](ArchiveFileList.md)
- [IsError](IsError.md)
- [JSON.Colorize](JSONColorize.md)

### Release notes

- **Version 14.5**
    - Changed [Archive.Content](https://www.mbsplugins.eu/ArchiveContent.shtml) to skip GID, UID, Permissions, RDev, FileType and HardLink fields, if not set.
- **Version 14.3**
    - Added Options parameter for [Archive.Content](https://www.mbsplugins.eu/ArchiveContent.shtml), [Archive.Extract](https://www.mbsplugins.eu/ArchiveExtract.shtml), [Archive.ExtractFile](https://www.mbsplugins.eu/ArchiveExtractFile.shtml), [Archive.FileList](https://www.mbsplugins.eu/ArchiveFileList.shtml) and [Archive.GZipDecompress](https://www.mbsplugins.eu/ArchiveGZipDecompress.shtml) functions.
- **Version 11.1**
    - Fixed memory leak in [Archive.Content](https://www.mbsplugins.eu/ArchiveContent.shtml) function.
- **Version 10.0**
    - Fixed problem in [Archive.FileList](https://www.mbsplugins.eu/ArchiveFileList.shtml) and [Archive.Content](https://www.mbsplugins.eu/ArchiveContent.shtml) not returning error if encrypted archive could not be read.
- **Version 9.2**
    - Changed [Archive.Content](http://www.mbsplugins.eu/ArchiveContent.shtml) to return error if archive is broken.
    - Fixed [Archive.Content](http://www.mbsplugins.eu/ArchiveContent.shtml) to return flags correctly.

### Example Databases

- [Archives/Archives](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Archives/Archives.shtml#1ScriptAnchor_)

### Blog Entries

- [MBS FileMaker Plugin, version 14.5pr1](https://www.mbsplugins.de/archive/2024-10-01/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 14.3pr7](https://www.mbsplugins.de/archive/2024-07-05/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 11.1pr2](https://www.mbsplugins.de/archive/2021-02-05/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [Embrace JSON](https://www.mbsplugins.de/archive/2020-09-29/Embrace_JSON/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 9.6pr3](https://www.mbsplugins.de/archive/2019-12-17/MBS_FileMaker_Plugin_version_9/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 9.2pr1](https://www.mbsplugins.de/archive/2019-04-02/MBS_FileMaker_Plugin_version_9/monkeybreadsoftware_blog_filemaker)

### FileMaker Magazin

- [Ausgabe 4/2023, Seite 39](https://filemaker-magazin.de/neuigkeit/4233-Appetithappen-FMM_202304)

This function checks for a license.

Created 8th December 2018 , last changed 5th September 2025

  
[Archive.CompressText](ArchiveCompressText.md) - [Archive.Create](ArchiveCreate.md)

[HTML Version](ArchiveContent.shtml)