Single-file ZIP
Single-file ZIP is a ZIP Archive sample generated for file format testing. It can be used to test downloads, parsers, previews, and file type detection.
single-file.zipArchive
ZIP Archive is a archive format commonly identified by .zip. Use the listed signatures, MIME types, and structure notes to validate files beyond the extension.
50 4B 03 04 PK..50 4B 05 06 PK..50 4B 07 08 PK..SIGNATURE = bytes.fromhex("504b0304")
OFFSET = 0
def is_zip(path: str) -> bool:
with open(path, "rb") as f:
f.seek(OFFSET)
head = f.read(len(SIGNATURE))
return head == SIGNATUREconst SIGNATURE = [0x50, 0x4b, 0x03, 0x04];
const OFFSET = 0;
// bytes: a Uint8Array / Buffer holding the start of the file
export function isZip(bytes) {
return SIGNATURE.every((byte, i) => bytes[OFFSET + i] === byte);
}package fileid
import "bytes"
var iszipSignature = []byte{0x50, 0x4b, 0x03, 0x04}
const iszipOffset = 0
func IsZip(b []byte) bool {
end := iszipOffset + len(iszipSignature)
if len(b) < end {
return false
}
return bytes.Equal(b[iszipOffset:end], iszipSignature)
}const SIGNATURE: &[u8] = &[0x50, 0x4b, 0x03, 0x04];
const OFFSET: usize = 0;
fn is_zip(bytes: &[u8]) -> bool {
bytes.get(OFFSET..OFFSET + SIGNATURE.len()) == Some(SIGNATURE)
}<?php
$signature = "\x50\x4b\x03\x04";
$offset = 0;
function is_zip(string $bytes): bool {
global $signature, $offset;
return substr($bytes, $offset, strlen($signature)) === $signature;
}ZIP Archive is used for compression, extraction, backups, attachments, and multi-file inspection. Validate paths, file counts, compressed size, and extracted size before unpacking.
Archives can contain zip-slip paths, excessive expansion, hidden files, and double extensions. Normalize extraction paths and enforce file count and size limits.
11 samples help test leading-byte detection, parser errors, upload limits, and download behavior.
Single-file ZIP is a ZIP Archive sample generated for file format testing. It can be used to test downloads, parsers, previews, and file type detection.
single-file.zipEmpty ZIP is a ZIP Archive sample generated for file format testing. It can be used to test downloads, parsers, previews, and file type detection.
empty.zipTwo File ZIP is a ZIP Archive sample generated for file format testing. It can be used to test downloads, parsers, previews, and file type detection.
two-files.zipBlue Sky ZIP is a ZIP Archive sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.
01-blue-sky.zip406899035ac2a5ebd7641aaf09b0026caf34ae6414f224801a2df79888baab21Flower Garden ZIP is a ZIP Archive sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.
02-flower-garden.zip9ff8454befd465893ed4f21427fb53aff3b830d7501e125445d32b27e6d71477Navy Blue Sky ZIP is a ZIP Archive sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.
03-navy-blue-sky.zip821a889e4ca078ef99efa381eaf06128e7859bf439ee3eb53f099eea43af5b13Nature of the Sky ZIP is a ZIP Archive sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.
04-nature-sky.zip4b7eef406dfa9120a46e419abf15f8d5fdd4b59f82e41548e895b3859d1c81eeSky Landscape ZIP is a ZIP Archive sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.
05-sky-landscape.zip1efa3a18f71d6235167237cdc8611dbacd9812b6aac86d5fdac2e87843a0a96fStarry Sky ZIP is a ZIP Archive sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.
06-starry-sky.zip9dea35b1174a734275f911257297b00a3f7269459b6f99becfc061f3e4cfeed1Blue Night Sky ZIP is a ZIP Archive sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.
07-blue-night-sky.zipae59106122a39caf2142ab9cb6947522d55b5afeba9d8d89fa63d5801fcb752bNASA Blue Marble ZIP is a ZIP Archive sample based on NASA Image and Video Library. It can be used to test downloads, parsers, previews, and file type detection.
nasa-blue-marble-2012-east.zip527dd0ee5ce84bfea705fa242f5a9bd38c951d91f9c2c37f79ab8766612530dbZIP Archive files begin with the byte signature 50 4B 03 04 ("PK..") or 50 4B 05 06 ("PK..") or 50 4B 07 08 ("PK.."). Detect the format by reading these leading bytes rather than trusting the file extension alone.
The MIME type for ZIP Archive is application/zip.
ZIP Archive files use the .zip extension. The extension is a convention only and does not guarantee the file contents, so combine it with signature and structure checks.