Use the getZip method to retrieve a directory in Delta Storage as a compressed ZIP archive.

try {
  const directoryId = 'directory_id_here' // The ID of the directory to retrieve as a ZIP archive.
  const zipFileName = 'retrieved_directory' // The name of the ZIP file to save on the client side.
  const result = await sdk.directory.getZip(directoryId, zipFileName)
  if (result.success) {
    console.log(`Directory retrieved as ZIP: ${zipFileName}.zip`)
  } else {
    console.error('Failed to retrieve the directory as a ZIP file.')
  }
} catch (error) {
  console.error(error.message)
}

Params

  • directoryId - The ID of the directory to be zipped and downloaded.
  • zipFileName - The name of the downloaded ZIP file (excluding the ".zip" extension).

Required API Key Permission

  • Read Directory