ZIP, TAR and Gzip Archive Formats: Technical Questions and Answers
Engineering reference covering Technical Questions and Answers on Central Directory ZIP archives, 512-byte POSIX ustar tape blocks, and RFC 1952 DEFLATE streams, how each format works at the byte level, how our deterministic generator builds and verifies them, and how to test them in QA pipelines.
Format hubs covered on this reference page
Part 1: Binary signatures, headers and specification rules
- 1. What leading byte signature or magic number identifies a ZIP (.zip) file at offset 0?
- When a binary inspector reads the start of a .zip stream, it checks for 50 4B 03 04. In ZIP files, this signature is part of PKWARE APPNOTE container consisting of Local File Headers (50 4B 03 04), DEFLATE or STORE payload data, Central Directory File Headers (50 4B 01 02), and an End of Central Directory record (50 4B 05 06) at the end of the file.
- 2. Which IANA MIME media type should an HTTP server return in Content-Type for .zip downloads?
- Standardized delivery of ZIP uses application/zip. If a server sends a generic type without X-Content-Type-Options: nosniff, browsers may misinterpret .zip payloads.
- 3. How does the internal structure of a ZIP (.zip) file organize headers and payload data?
- Inside .zip, data is arranged as PKWARE APPNOTE container consisting of Local File Headers (50 4B 03 04), DEFLATE or STORE payload data, Central Directory File Headers (50 4B 01 02), and an End of Central Directory record (50 4B 05 06) at the end of the file. Parsers such as Python zipfile, Info-ZIP unzip, 7-Zip, libarchive, JSZip, and fflate validate this layout before extracting application content.
- 4. What is the smallest valid byte size that the SampleTestFiles generator allows for .zip?
- The minimum valid size for a generated ZIP fixture on this site is 322 bytes (with a step increment of 1 byte), because a smaller buffer cannot hold the required .zip header and trailer structures.
- 5. How does SampleTestFiles pad a .zip file to reach an exact byte count like 10,240 bytes or 1,048,576 bytes?
- Instead of appending null bytes past the end of the file, our deterministic .zip builder achieves exact byte targets by adjusting archive member content and extra-field bytes with recomputed IEEE CRC-32 checksums and exact Central Directory offsets.
- 6. What happens when a .zip transfer is cut off halfway through uploading or downloading?
- In ZIP streams, corrupting payload bytes so the computed CRC-32 disagrees with the header (tested by our zip-corrupted-crc fixture) or Zip Slip '../' path traversal. Testing this behavior verifies that your ingestion worker returns a 400 or 422 validation error instead of crashing.
- 7. Which open-source libraries and desktop programs are commonly used to parse or inspect .zip fixtures?
- Engineers typically validate and parse .zip files using Python zipfile, Info-ZIP unzip, 7-Zip, libarchive, JSZip, and fflate, each of which checks the specification rules defined by PKWARE APPNOTE.
- 8. What are the primary software engineering and QA use cases for sample .zip files?
- Teams use deterministic .zip fixtures for bulk file export/import, software release packaging, Lambda/Function deployment bundles, and antivirus archive scanning, ensuring both small 10 KB unit tests and large 100 MB stress tests behave predictably.
- 9. How does in-browser Web Worker generation work for .zip files up to 32 MB?
- When you request a .zip sample of 32 MB or less on /formats/zip/, a background Web Worker runs our seeded generator off the main UI thread, builds the ZIP blob in memory, verifies its SHA-256 hash via Web Crypto, and triggers a local download.
- 10. How does Service Worker streaming create 50 MB to 1 GB .zip files without running out of browser RAM?
- For .zip sizes above 32 MB on Chromium and Firefox, /sw.js intercepts the local /__gen/f/zip/ request and emits 1 MB chunks through a ReadableStream directly to the browser download manager so the full file never resides in memory.
- 11. What is the published SHA-256 checksum for the 1kb (1,024-byte) .zip sample file?
- The deterministic sample-zip-1kb.zip fixture (1,024 bytes) has the SHA-256 digest d93f32774a20ef7e6b79b8a8981f1db9a3003f9104894d9ae6273f797757f461. Every build produces those exact bytes.
- 12. What is the exact byte count and SHA-256 hash of sample-zip-10kb.zip?
- The file sample-zip-10kb.zip measures exactly 10,240 bytes and its SHA-256 checksum is 4dd363933f22f3a6e85c9426ea34832c0e1c9d37c10ddd2ce0fd8f0db37a2075.
- 13. What is the exact byte length and SHA-256 digest of the 100kb .zip fixture (sample-zip-100kb.zip)?
- The 100kb ZIP fixture (sample-zip-100kb.zip) is 102,400 bytes long with SHA-256 hash edaf992d5a707e59e089aa82adc3061e01e771ba8bf427500bc681b08f576466.
- 14. How do I verify a downloaded .zip sample on Linux, macOS, and Windows PowerShell?
- Run sha256sum sample-zip-10kb.zip on Linux, shasum -a 256 sample-zip-10kb.zip on macOS, or Get-FileHash sample-zip-10kb.zip -Algorithm SHA256 in Windows PowerShell, and compare the output against /formats/zip/.
- 15. Why can a browser report the wrong file.type when a user selects a renamed .zip file in an <input type='file'> control?
- Browsers populate File.type from the operating system extension mapping rather than reading the file's 50 4B 03 04 signature. Dropping the file into /inspector/ or checking magic bytes on the backend prevents spoofed .zip uploads.
- 16. How do I attach a sample .zip file to an automated upload test in Playwright?
- Save the .zip fixture from /formats/zip/ into your test directory and call await page.locator('input[type="file"]').setInputFiles('fixtures/sample-zip-10kb.zip') before submitting the form.
- 17. How do I test .zip file uploads in Cypress and Selenium WebDriver?
- In Cypress, run cy.get('input[type="file"]').selectFile('cypress/fixtures/sample-zip-10kb.zip'). In Selenium WebDriver, pass the absolute filesystem path of the .zip sample to WebElement.sendKeys().
- 18. Does HTTP gzip or Brotli transfer compression shrink a .zip file over the network?
- For ZIP (Deflate or none per entry; others are optional), network compression effectiveness depends on whether the payload is already entropy-coded; text-based formats compress heavily with Brotli, while pre-compressed binary streams gain almost nothing and waste CPU.
- 19. What happens if an API gateway or middleware reads a binary .zip upload as a UTF-8 string?
- Decoding binary .zip bytes as UTF-8 replaces any byte sequence invalid in UTF-8 with the 3-byte replacement character EF BF BD (U+FFFD), permanently corrupting PKWARE APPNOTE container consisting of Local File Headers (50 4B 03 04), DEFLATE or STORE payload data, Central Directory File Headers (50 4B 01 02), and an End of Central Directory record (50 4B 05 06) at the end of the file.
- 20. How does the in-browser preview on /sample-files/zip/10kb/ display .zip contents safely?
- When you click Preview file on a .zip sample page, the file previewer generates or slices the local Blob in memory and renders text nodes or native media controls without executing untrusted markup.
- 21. Why are Safari and iOS browsers capped at a lower maximum in-memory size for .zip than desktop Chrome or Firefox?
- WebKit on macOS and iOS does not hand streamed Service Worker responses to its download manager reliably, so the download controller assembles .zip files in RAM within a safe device ceiling (64 MB on iOS, 256 MB on desktop Safari).
- 22. Do the sample .zip files on SampleTestFiles contain any real personal data or third-party copyrighted material?
- No. Every .zip file is synthesized deterministically by our own generator from mathematical patterns and invented records (using reserved example.com domains) under our CC0 public-domain licence (/licence/).
- 23. What specification or standard defines the .zip format implemented by our generator?
- Our ZIP generator follows PKWARE APPNOTE, ensuring every header field and delimiter matches what Python zipfile, Info-ZIP unzip, 7-Zip, libarchive, JSZip, and fflate expect.
- 24. How should a backend service store uploaded .zip files in S3, object storage, or Google Cloud Storage?
- Validate the .zip magic signature (50 4B 03 04) on the first chunk, generate a UUID storage key instead of trusting the user filename, set Content-Type to application/zip, and store the SHA-256 hex digest in object metadata.
- 25. Which size presets of .zip are best for testing nginx client_max_body_size and AWS API Gateway limits?
- Use the 1 MB and 2 MB .zip presets on /formats/zip/ to test nginx's default 1m client_max_body_size, and use the 10 MB and 15 MB .zip presets to test AWS API Gateway's 10 MB payload boundary.
Part 2: Internal container layout, padding and byte structure
- 1. What does the ZIP (.zip) specification table record for 'Extension'?
- For .zip files in the Archives category, the 'Extension' attribute is defined as: .zip. Parsers rely on this property when validating ZIP streams.
- 2. What does the ZIP (.zip) specification table record for 'MIME type'?
- For .zip files in the Archives category, the 'MIME type' attribute is defined as: application/zip. Parsers rely on this property when validating ZIP streams.
- 3. What does the ZIP (.zip) specification table record for 'Also seen as'?
- For .zip files in the Archives category, the 'Also seen as' attribute is defined as: application/x-zip-compressed. Parsers rely on this property when validating ZIP streams.
- 4. What does the ZIP (.zip) specification table record for 'Specification'?
- For .zip files in the Archives category, the 'Specification' attribute is defined as: PKWARE APPNOTE. Parsers rely on this property when validating ZIP streams.
- 5. What does the ZIP (.zip) specification table record for 'Compression'?
- For .zip files in the Archives category, the 'Compression' attribute is defined as: Deflate or none per entry; others are optional. Parsers rely on this property when validating ZIP streams.
- 6. What does the ZIP (.zip) specification table record for 'Directory'?
- For .zip files in the Archives category, the 'Directory' attribute is defined as: At the end of the file. Parsers rely on this property when validating ZIP streams.
- 7. What does the ZIP (.zip) specification table record for 'Large files'?
- For .zip files in the Archives category, the 'Large files' attribute is defined as: ZIP64 extensions beyond 4 GB or 65,535 entries. Parsers rely on this property when validating ZIP streams.
- 8. What is inside the 1kb ZIP sample (sample-zip-1kb.zip) and what is its exact byte count?
- The 1kb .zip fixture (sample-zip-1kb.zip) contains PKWARE APPNOTE container consisting of Local File Headers (50 4B 03 04), DEFLATE or STORE payload data, Central Directory File Headers (50 4B 01 02), and an End of Central Directory record (50 4B 05 06) at the end of the file. Its exact length is 1,024 bytes (1 1kb binary units) and its verified SHA-256 checksum is d93f32774a20ef7e6b79b8a8981f1db9a3003f9104894d9ae6273f797757f461.
- 9. What is inside the 5kb ZIP sample (sample-zip-5kb.zip) and what is its exact byte count?
- The 5kb .zip fixture (sample-zip-5kb.zip) contains PKWARE APPNOTE container consisting of Local File Headers (50 4B 03 04), DEFLATE or STORE payload data, Central Directory File Headers (50 4B 01 02), and an End of Central Directory record (50 4B 05 06) at the end of the file. Its exact length is 5,120 bytes (1 5kb binary units) and its verified SHA-256 checksum is 2aa7075ccae98cf4a9c2fbf0c86fc1c600a3c9d63bc92232eb0453a7ca87c03d.
- 10. What leading byte signature or magic number identifies a TAR (.tar) file at offset 0?
- When a binary inspector reads the start of a .tar stream, it checks for 75 73 74 61 72 at byte offset 257. In TAR files, this signature is part of sequential 512-byte blocks where each archived file is preceded by a 512-byte POSIX ustar header (magic 'ustar' 75 73 74 61 72 at byte offset 257, octal size/mtime/mode fields, and an 8-byte header checksum), terminated by at least two 512-byte zero blocks.
- 11. Which IANA MIME media type should an HTTP server return in Content-Type for .tar downloads?
- Standardized delivery of TAR uses application/x-tar. If a server sends a generic type without X-Content-Type-Options: nosniff, browsers may misinterpret .tar payloads.
- 12. How does the internal structure of a TAR (.tar) file organize headers and payload data?
- Inside .tar, data is arranged as sequential 512-byte blocks where each archived file is preceded by a 512-byte POSIX ustar header (magic 'ustar' 75 73 74 61 72 at byte offset 257, octal size/mtime/mode fields, and an 8-byte header checksum), terminated by at least two 512-byte zero blocks. Parsers such as GNU tar, bsdtar (libarchive), Python tarfile, and node-tar validate this layout before extracting application content.
- 13. What is the smallest valid byte size that the SampleTestFiles generator allows for .tar?
- The minimum valid size for a generated TAR fixture on this site is 2,560 bytes (with a step increment of 512 bytes), because a smaller buffer cannot hold the required .tar header and trailer structures.
- 14. How does SampleTestFiles pad a .tar file to reach an exact byte count like 10,240 bytes or 1,048,576 bytes?
- Instead of appending null bytes past the end of the file, our deterministic .tar builder achieves exact byte targets by sizing archived member payload and trailing 512-byte zero padding blocks in 512-byte increments.
- 15. What happens when a .tar transfer is cut off halfway through uploading or downloading?
- In TAR streams, checking offset 0 for magic bytes instead of offset 257 ('ustar'), or failing to validate octal header checksums. Testing this behavior verifies that your ingestion worker returns a 400 or 422 validation error instead of crashing.
- 16. Which open-source libraries and desktop programs are commonly used to parse or inspect .tar fixtures?
- Engineers typically validate and parse .tar files using GNU tar, bsdtar (libarchive), Python tarfile, and node-tar, each of which checks the specification rules defined by POSIX ustar and pax.
- 17. What are the primary software engineering and QA use cases for sample .tar files?
- Teams use deterministic .tar fixtures for Docker/OCI container layer inspection, Linux backup pipelines, and streaming archive extraction without random seeks, ensuring both small 10 KB unit tests and large 100 MB stress tests behave predictably.
- 18. How does in-browser Web Worker generation work for .tar files up to 32 MB?
- When you request a .tar sample of 32 MB or less on /formats/tar/, a background Web Worker runs our seeded generator off the main UI thread, builds the TAR blob in memory, verifies its SHA-256 hash via Web Crypto, and triggers a local download.
- 19. How does Service Worker streaming create 50 MB to 1 GB .tar files without running out of browser RAM?
- For .tar sizes above 32 MB on Chromium and Firefox, /sw.js intercepts the local /__gen/f/tar/ request and emits 1 MB chunks through a ReadableStream directly to the browser download manager so the full file never resides in memory.
- 20. What is the published SHA-256 checksum for the 10kb (10,240-byte) .tar sample file?
- The deterministic sample-tar-10kb.tar fixture (10,240 bytes) has the SHA-256 digest 4c6ff6563d9c00f0e484350c729769ebc7dbdc18e26b408a63b5ae6c27f98d5c. Every build produces those exact bytes.
- 21. What is the exact byte count and SHA-256 hash of sample-tar-1mb.tar?
- The file sample-tar-1mb.tar measures exactly 1,048,576 bytes and its SHA-256 checksum is 74e3b857f9d2f0644e7e5f6b3f85092b0d7a7f058f8ac221804f018aef11edf4.
- 22. What is the exact byte length and SHA-256 digest of the 5kb .tar fixture (sample-tar-5kb.tar)?
- The 5kb TAR fixture (sample-tar-5kb.tar) is 5,120 bytes long with SHA-256 hash 426b1af8b8384a30d4802cd96e08311d7d00bf9a75cbad8eec8be76c172151a0.
- 23. How do I verify a downloaded .tar sample on Linux, macOS, and Windows PowerShell?
- Run sha256sum sample-tar-10kb.tar on Linux, shasum -a 256 sample-tar-10kb.tar on macOS, or Get-FileHash sample-tar-10kb.tar -Algorithm SHA256 in Windows PowerShell, and compare the output against /formats/tar/.
- 24. Why can a browser report the wrong file.type when a user selects a renamed .tar file in an <input type='file'> control?
- Browsers populate File.type from the operating system extension mapping rather than reading the file's 75 73 74 61 72 at byte offset 257 signature. Dropping the file into /inspector/ or checking magic bytes on the backend prevents spoofed .tar uploads.
- 25. How do I attach a sample .tar file to an automated upload test in Playwright?
- Save the .tar fixture from /formats/tar/ into your test directory and call await page.locator('input[type="file"]').setInputFiles('fixtures/sample-tar-10kb.tar') before submitting the form.
Part 3: In-browser generation, streaming and SHA-256 checksums
- 1. How do I test .tar file uploads in Cypress and Selenium WebDriver?
- In Cypress, run cy.get('input[type="file"]').selectFile('cypress/fixtures/sample-tar-10kb.tar'). In Selenium WebDriver, pass the absolute filesystem path of the .tar sample to WebElement.sendKeys().
- 2. Does HTTP gzip or Brotli transfer compression shrink a .tar file over the network?
- For TAR (None; usually wrapped in gzip, bzip2, xz or zstd), network compression effectiveness depends on whether the payload is already entropy-coded; text-based formats compress heavily with Brotli, while pre-compressed binary streams gain almost nothing and waste CPU.
- 3. What happens if an API gateway or middleware reads a binary .tar upload as a UTF-8 string?
- Decoding binary .tar bytes as UTF-8 replaces any byte sequence invalid in UTF-8 with the 3-byte replacement character EF BF BD (U+FFFD), permanently corrupting sequential 512-byte blocks where each archived file is preceded by a 512-byte POSIX ustar header (magic 'ustar' 75 73 74 61 72 at byte offset 257, octal size/mtime/mode fields, and an 8-byte header checksum), terminated by at least two 512-byte zero blocks.
- 4. How does the in-browser preview on /sample-files/tar/10kb/ display .tar contents safely?
- When you click Preview file on a .tar sample page, the file previewer generates or slices the local Blob in memory and renders text nodes or native media controls without executing untrusted markup.
- 5. Why are Safari and iOS browsers capped at a lower maximum in-memory size for .tar than desktop Chrome or Firefox?
- WebKit on macOS and iOS does not hand streamed Service Worker responses to its download manager reliably, so the download controller assembles .tar files in RAM within a safe device ceiling (64 MB on iOS, 256 MB on desktop Safari).
- 6. Do the sample .tar files on SampleTestFiles contain any real personal data or third-party copyrighted material?
- No. Every .tar file is synthesized deterministically by our own generator from mathematical patterns and invented records (using reserved example.com domains) under our CC0 public-domain licence (/licence/).
- 7. What specification or standard defines the .tar format implemented by our generator?
- Our TAR generator follows POSIX ustar and pax, ensuring every header field and delimiter matches what GNU tar, bsdtar (libarchive), Python tarfile, and node-tar expect.
- 8. How should a backend service store uploaded .tar files in S3, object storage, or Google Cloud Storage?
- Validate the .tar magic signature (75 73 74 61 72 at byte offset 257) on the first chunk, generate a UUID storage key instead of trusting the user filename, set Content-Type to application/x-tar, and store the SHA-256 hex digest in object metadata.
- 9. Which size presets of .tar are best for testing nginx client_max_body_size and AWS API Gateway limits?
- Use the 1 MB and 2 MB .tar presets on /formats/tar/ to test nginx's default 1m client_max_body_size, and use the 10 MB and 15 MB .tar presets to test AWS API Gateway's 10 MB payload boundary.
- 10. What does the TAR (.tar) specification table record for 'Extension'?
- For .tar files in the Archives category, the 'Extension' attribute is defined as: .tar. Parsers rely on this property when validating TAR streams.
- 11. What does the TAR (.tar) specification table record for 'MIME type'?
- For .tar files in the Archives category, the 'MIME type' attribute is defined as: application/x-tar. Parsers rely on this property when validating TAR streams.
- 12. What does the TAR (.tar) specification table record for 'Specification'?
- For .tar files in the Archives category, the 'Specification' attribute is defined as: POSIX ustar and pax. Parsers rely on this property when validating TAR streams.
- 13. What does the TAR (.tar) specification table record for 'Block size'?
- For .tar files in the Archives category, the 'Block size' attribute is defined as: 512 bytes. Parsers rely on this property when validating TAR streams.
- 14. What does the TAR (.tar) specification table record for 'Compression'?
- For .tar files in the Archives category, the 'Compression' attribute is defined as: None; usually wrapped in gzip, bzip2, xz or zstd. Parsers rely on this property when validating TAR streams.
- 15. What does the TAR (.tar) specification table record for 'End marker'?
- For .tar files in the Archives category, the 'End marker' attribute is defined as: Two blocks of zero bytes. Parsers rely on this property when validating TAR streams.
- 16. What is inside the 10kb TAR sample (sample-tar-10kb.tar) and what is its exact byte count?
- The 10kb .tar fixture (sample-tar-10kb.tar) contains sequential 512-byte blocks where each archived file is preceded by a 512-byte POSIX ustar header (magic 'ustar' 75 73 74 61 72 at byte offset 257, octal size/mtime/mode fields, and an 8-byte header checksum), terminated by at least two 512-byte zero blocks. Its exact length is 10,240 bytes (1 10kb binary units) and its verified SHA-256 checksum is 4c6ff6563d9c00f0e484350c729769ebc7dbdc18e26b408a63b5ae6c27f98d5c.
- 17. What is inside the 100kb TAR sample (sample-tar-100kb.tar) and what is its exact byte count?
- The 100kb .tar fixture (sample-tar-100kb.tar) contains sequential 512-byte blocks where each archived file is preceded by a 512-byte POSIX ustar header (magic 'ustar' 75 73 74 61 72 at byte offset 257, octal size/mtime/mode fields, and an 8-byte header checksum), terminated by at least two 512-byte zero blocks. Its exact length is 102,400 bytes (1 100kb binary units) and its verified SHA-256 checksum is 728bbc97da3db4bd1102dba2cf4e74b1ad81791dfce027f3593fbffae2c92ebe.
- 18. What leading byte signature or magic number identifies a GZ (.gz) file at offset 0?
- When a binary inspector reads the start of a .gz stream, it checks for 1F 8B 08. In GZ files, this signature is part of IETF RFC 1952 stream starting with a 10-byte header (1F 8B 08, flags, 32-bit mtime, extra flags, OS byte), a DEFLATE-compressed payload (RFC 1951), and an 8-byte trailer containing the 32-bit CRC-32 and 32-bit uncompressed size modulo 2^32 (ISIZE).
- 19. Which IANA MIME media type should an HTTP server return in Content-Type for .gz downloads?
- Standardized delivery of GZ uses application/gzip. If a server sends a generic type without X-Content-Type-Options: nosniff, browsers may misinterpret .gz payloads.
- 20. How does the internal structure of a GZ (.gz) file organize headers and payload data?
- Inside .gz, data is arranged as IETF RFC 1952 stream starting with a 10-byte header (1F 8B 08, flags, 32-bit mtime, extra flags, OS byte), a DEFLATE-compressed payload (RFC 1951), and an 8-byte trailer containing the 32-bit CRC-32 and 32-bit uncompressed size modulo 2^32 (ISIZE). Parsers such as GNU gzip/zcat, zlib, Python gzip, libdeflate, and browser DecompressionStream('gzip') validate this layout before extracting application content.
- 21. What is the smallest valid byte size that the SampleTestFiles generator allows for .gz?
- The minimum valid size for a generated GZ fixture on this site is 35 bytes (with a step increment of 1 byte), because a smaller buffer cannot hold the required .gz header and trailer structures.
- 22. How does SampleTestFiles pad a .gz file to reach an exact byte count like 10,240 bytes or 1,048,576 bytes?
- Instead of appending null bytes past the end of the file, our deterministic .gz builder achieves exact byte targets by calibrating the uncompressed input stream or FEXTRA/FCOMMENT header fields so the compressed output plus 8-byte trailer lands on the exact byte size.
- 23. What happens when a .gz transfer is cut off halfway through uploading or downloading?
- In GZ streams, relying on the trailing 4-byte ISIZE field for files over 4 GB (since ISIZE wraps modulo 2^32). Testing this behavior verifies that your ingestion worker returns a 400 or 422 validation error instead of crashing.
- 24. Which open-source libraries and desktop programs are commonly used to parse or inspect .gz fixtures?
- Engineers typically validate and parse .gz files using GNU gzip/zcat, zlib, Python gzip, libdeflate, and browser DecompressionStream('gzip'), each of which checks the specification rules defined by RFC 1952.
- 25. What are the primary software engineering and QA use cases for sample .gz files?
- Teams use deterministic .gz fixtures for HTTP Content-Encoding verification, log compression pipelines, database dump archiving, and streaming decompression tests, ensuring both small 10 KB unit tests and large 100 MB stress tests behave predictably.
Part 4: Parser libraries, edge cases and automated QA testing
- 1. How does in-browser Web Worker generation work for .gz files up to 32 MB?
- When you request a .gz sample of 32 MB or less on /formats/gz/, a background Web Worker runs our seeded generator off the main UI thread, builds the GZ blob in memory, verifies its SHA-256 hash via Web Crypto, and triggers a local download.
- 2. How does Service Worker streaming create 50 MB to 1 GB .gz files without running out of browser RAM?
- For .gz sizes above 32 MB on Chromium and Firefox, /sw.js intercepts the local /__gen/f/gz/ request and emits 1 MB chunks through a ReadableStream directly to the browser download manager so the full file never resides in memory.
- 3. What is the published SHA-256 checksum for the 1kb (1,024-byte) .gz sample file?
- The deterministic sample-gz-1kb.gz fixture (1,024 bytes) has the SHA-256 digest d67bc6e2b98c4e46e378f3abad3e4cd5cc23bd52e38bf2691a5ef9d86689eb7a. Every build produces those exact bytes.
- 4. What is the exact byte count and SHA-256 hash of sample-gz-100kb.gz?
- The file sample-gz-100kb.gz measures exactly 102,400 bytes and its SHA-256 checksum is 22386f248cc2b9f4a7b86e2d51b4b91c3ae8654485928648ec5e18188749b6ed.
- 5. What is the exact byte length and SHA-256 digest of the 10mb .gz fixture (sample-gz-10mb.gz)?
- The 10mb GZ fixture (sample-gz-10mb.gz) is 10,485,760 bytes long with SHA-256 hash 3d15ff97f953add627bb840ef18b0b8829d78ef75b71a7e4fe851aec28d88eb8.
- 6. How do I verify a downloaded .gz sample on Linux, macOS, and Windows PowerShell?
- Run sha256sum sample-gz-10kb.gz on Linux, shasum -a 256 sample-gz-10kb.gz on macOS, or Get-FileHash sample-gz-10kb.gz -Algorithm SHA256 in Windows PowerShell, and compare the output against /formats/gz/.
- 7. Why can a browser report the wrong file.type when a user selects a renamed .gz file in an <input type='file'> control?
- Browsers populate File.type from the operating system extension mapping rather than reading the file's 1F 8B 08 signature. Dropping the file into /inspector/ or checking magic bytes on the backend prevents spoofed .gz uploads.
- 8. How do I attach a sample .gz file to an automated upload test in Playwright?
- Save the .gz fixture from /formats/gz/ into your test directory and call await page.locator('input[type="file"]').setInputFiles('fixtures/sample-gz-10kb.gz') before submitting the form.
- 9. How do I test .gz file uploads in Cypress and Selenium WebDriver?
- In Cypress, run cy.get('input[type="file"]').selectFile('cypress/fixtures/sample-gz-10kb.gz'). In Selenium WebDriver, pass the absolute filesystem path of the .gz sample to WebElement.sendKeys().
- 10. Does HTTP gzip or Brotli transfer compression shrink a .gz file over the network?
- For GZ (Deflate (RFC 1951)), network compression effectiveness depends on whether the payload is already entropy-coded; text-based formats compress heavily with Brotli, while pre-compressed binary streams gain almost nothing and waste CPU.
- 11. What happens if an API gateway or middleware reads a binary .gz upload as a UTF-8 string?
- Decoding binary .gz bytes as UTF-8 replaces any byte sequence invalid in UTF-8 with the 3-byte replacement character EF BF BD (U+FFFD), permanently corrupting IETF RFC 1952 stream starting with a 10-byte header (1F 8B 08, flags, 32-bit mtime, extra flags, OS byte), a DEFLATE-compressed payload (RFC 1951), and an 8-byte trailer containing the 32-bit CRC-32 and 32-bit uncompressed size modulo 2^32 (ISIZE).
- 12. How does the in-browser preview on /sample-files/gz/10kb/ display .gz contents safely?
- When you click Preview file on a .gz sample page, the file previewer generates or slices the local Blob in memory and renders text nodes or native media controls without executing untrusted markup.
- 13. Why are Safari and iOS browsers capped at a lower maximum in-memory size for .gz than desktop Chrome or Firefox?
- WebKit on macOS and iOS does not hand streamed Service Worker responses to its download manager reliably, so the download controller assembles .gz files in RAM within a safe device ceiling (64 MB on iOS, 256 MB on desktop Safari).
- 14. Do the sample .gz files on SampleTestFiles contain any real personal data or third-party copyrighted material?
- No. Every .gz file is synthesized deterministically by our own generator from mathematical patterns and invented records (using reserved example.com domains) under our CC0 public-domain licence (/licence/).
- 15. What specification or standard defines the .gz format implemented by our generator?
- Our GZ generator follows RFC 1952, ensuring every header field and delimiter matches what GNU gzip/zcat, zlib, Python gzip, libdeflate, and browser DecompressionStream('gzip') expect.
- 16. How should a backend service store uploaded .gz files in S3, object storage, or Google Cloud Storage?
- Validate the .gz magic signature (1F 8B 08) on the first chunk, generate a UUID storage key instead of trusting the user filename, set Content-Type to application/gzip, and store the SHA-256 hex digest in object metadata.
- 17. Which size presets of .gz are best for testing nginx client_max_body_size and AWS API Gateway limits?
- Use the 1 MB and 2 MB .gz presets on /formats/gz/ to test nginx's default 1m client_max_body_size, and use the 10 MB and 15 MB .gz presets to test AWS API Gateway's 10 MB payload boundary.
- 18. What does the GZ (.gz) specification table record for 'Extension'?
- For .gz files in the Archives category, the 'Extension' attribute is defined as: .gz. Parsers rely on this property when validating GZ streams.
- 19. What does the GZ (.gz) specification table record for 'MIME type'?
- For .gz files in the Archives category, the 'MIME type' attribute is defined as: application/gzip. Parsers rely on this property when validating GZ streams.
- 20. What does the GZ (.gz) specification table record for 'Also seen as'?
- For .gz files in the Archives category, the 'Also seen as' attribute is defined as: application/x-gzip. Parsers rely on this property when validating GZ streams.
- 21. What does the GZ (.gz) specification table record for 'Specification'?
- For .gz files in the Archives category, the 'Specification' attribute is defined as: RFC 1952. Parsers rely on this property when validating GZ streams.
- 22. What does the GZ (.gz) specification table record for 'Compression'?
- For .gz files in the Archives category, the 'Compression' attribute is defined as: Deflate (RFC 1951). Parsers rely on this property when validating GZ streams.
- 23. What does the GZ (.gz) specification table record for 'Integrity'?
- For .gz files in the Archives category, the 'Integrity' attribute is defined as: CRC-32 and length of the uncompressed data. Parsers rely on this property when validating GZ streams.
- 24. What does the GZ (.gz) specification table record for 'Optional header fields'?
- For .gz files in the Archives category, the 'Optional header fields' attribute is defined as: Original file name, comment, extra data. Parsers rely on this property when validating GZ streams.
- 25. What is inside the 1kb GZ sample (sample-gz-1kb.gz) and what is its exact byte count?
- The 1kb .gz fixture (sample-gz-1kb.gz) contains IETF RFC 1952 stream starting with a 10-byte header (1F 8B 08, flags, 32-bit mtime, extra flags, OS byte), a DEFLATE-compressed payload (RFC 1951), and an 8-byte trailer containing the 32-bit CRC-32 and 32-bit uncompressed size modulo 2^32 (ISIZE). Its exact length is 1,024 bytes (1 1kb binary units) and its verified SHA-256 checksum is d67bc6e2b98c4e46e378f3abad3e4cd5cc23bd52e38bf2691a5ef9d86689eb7a.
Explore more topic-based technical format references
Browse all 20 deep-dive Q&A guides on Testing guides or Frequently asked questions.