zip-extractor
Service icon

Zip Extractor

Stable version 1.0.0 (Compatible with OutSystems 11)
Uploaded
 on 25 Sep
 by 
5.0
 (2 ratings)
zip-extractor

Zip Extractor

Documentation
1.0.0

A small, dependency-free OutSystems server-side component that extracts files from ZIP archives. It exposes two actions: ExtractZipFromBase64 and ExtractZipFromBinary. Both return a list of files where each file contains a Name and Content attribute. The component runs without any external or third-party integrations.
Provide a simple, robust, and safe way to decode and extract ZIP archives supplied either as a Base64 string or as binary data. The component returns each entry in the archive as a structure containing the file name (including relative path inside the archive) and the file content (binary), so the caller can persist files, stream them to users, or process them further.


  • Use server-side runtime APIs (.NET classes) to open and enumerate ZIP entries.
  • Do not call external web services or third-party packages — the component must remain self-contained.
  • For each zip entry that is a file:
    1. Read its full content into a binary buffer.
    2. Create a ZipFile structure with Name set to the entry path and Content set to the binary buffer.
    3. Append to output list.
  • Skip directory-only entries (those that end with / or are marked as folders).
  • Preserve entry names exactly as they appear in the archive (do not normalize path separators unless you have a platform reason to do so).


Service Actions 

1) ExtractZipFromBase64

Description: Decode the provided Base64 string and extract the ZIP archive contents.

Inputs:

  • Base64ZipText (Required) — The ZIP file encoded as a Base64 string.

Outputs:

  • FilesList of ZipFile — The extracted files. See Structures section.

Behavior / Notes:

  • Decodes Base64Zip to bytes, then reads it as a ZIP archive and enumerates entries.
  • Each file entry becomes one ZipFile in the Files list.
  • Directory entries (folders) are ignored — only file entries are returned.
  • The Name field contains the entry's relative path inside the ZIP (e.g. folder/sub/file.txt).

Errors:

  • If Base64Zip is not valid Base64, the action should raise an error or return an empty list with an error message (implementation choice — recommended to raise a clear exception message).
  • If the decoded bytes are not a valid ZIP archive, the action should raise a NotAZipArchive style error.

2) ExtractZipFromBinary

Description: Read the provided binary data as a ZIP archive and extract contents.

Inputs:

  • ZipBinaryBinary (Required) — Raw ZIP bytes.

Outputs:

  • FilesList of ZipFile — The extracted files.

Behavior / Notes:

  • Reads ZipBinary directly and enumerates ZIP entries.
  • Same treatment for paths, directory entries, and errors as ExtractZipFromBase64.

Structures

ZipFile (Structure)

  • NameText — The relative path and filename inside the ZIP (e.g., invoices/2025-09/invoice-001.pdf).
  • ContentBinary — Raw bytes for that file entry.