ZIP Files API

Category: utility

Compress multiple files into a ZIP archive. Runs entirely in the browser using JSZip.

Endpoint

N/A Browser API (JSZip)
No Server API

Response

Content-Type: N/A

This tool creates ZIP files in the browser using JSZip. No server-side API is available.

// Browser-only: uses JSZip library

cURL Example

# No cURL equivalent — this tool runs in the browser

Code Samples

// ZIP creation using JSZip
import JSZip from 'jszip';

const zip = new JSZip();
zip.file('hello.txt', 'Hello World');
zip.file('data.json', JSON.stringify({key: 'value'}));

const blob = await zip.generateAsync({type: 'blob'});
// Download the ZIP file
# For server-side ZIP creation:
import zipfile

with zipfile.ZipFile('archive.zip', 'w') as zf:
    zf.write('file1.txt')
    zf.write('file2.txt')
// For server-side ZIP creation:
import java.util.zip.*;

ZipOutputStream zos = new ZipOutputStream(new FileOutputStream("archive.zip"));
zos.putNextEntry(new ZipEntry("file1.txt"));
zos.write(data);
zos.closeEntry();
zos.close();