PPTX and EPUB Formats: Technical Questions and Answers

Engineering reference covering Technical Questions and Answers on DrawingML slide decks and W3C EPUB 3 Open Container Format e-books, 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. How are slide dimensions stored inside ppt/presentation.xml?
The <p:sldSz cx='9144000' cy='5143500'/> element defines widescreen 16:9 slide dimensions in English Metric Units (EMUs), where 914,400 EMUs equal 1 inch.
2. Where are speaker notes stored inside a PPTX archive?
Speaker notes for each slide live in a separate XML part under ppt/notesSlides/notesSlideN.xml linked from ppt/slides/_rels/slideN.xml.rels.
3. How do template-based PPTX files reuse slide backgrounds and fonts?
Master slide layouts live under ppt/slideMasters/slideMaster1.xml and ppt/theme/theme1.xml so individual slides inherit typography and color schemes without duplicating XML.
4. What leading byte signature or magic number identifies a PPTX (.pptx) file at offset 0?
When a binary inspector reads the start of a .pptx stream, it checks for 50 4B 03 04. In PPTX files, this signature is part of an OpenXML ZIP archive holding ppt/presentation.xml, individual slide trees under ppt/slides/slideN.xml, ppt/slideLayouts/, and DrawingML vector/text shapes measured in English Metric Units (1 inch = 914,400 EMUs).
5. Which IANA MIME media type should an HTTP server return in Content-Type for .pptx downloads?
Standardized delivery of PPTX uses application/vnd.openxmlformats-officedocument.presentationml.presentation. If a server sends a generic type without X-Content-Type-Options: nosniff, browsers may misinterpret .pptx payloads.
6. How does the internal structure of a PPTX (.pptx) file organize headers and payload data?
Inside .pptx, data is arranged as an OpenXML ZIP archive holding ppt/presentation.xml, individual slide trees under ppt/slides/slideN.xml, ppt/slideLayouts/, and DrawingML vector/text shapes measured in English Metric Units (1 inch = 914,400 EMUs). Parsers such as python-pptx, Apache POI XSLF, LibreOffice Impress, and Google Slides importer validate this layout before extracting application content.
7. What is the smallest valid byte size that the SampleTestFiles generator allows for .pptx?
The minimum valid size for a generated PPTX fixture on this site is 36,864 bytes (with a step increment of 1 byte), because a smaller buffer cannot hold the required .pptx header and trailer structures.
8. How does SampleTestFiles pad a .pptx 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 .pptx builder achieves exact byte targets by embedding slide content and media streams inside ppt/media/ within the ZIP container to match the exact byte target.
9. What happens when a .pptx transfer is cut off halfway through uploading or downloading?
In PPTX streams, missing relationship entries in ppt/slides/_rels/slide1.xml.rels breaks embedded image and layout references when opened in PowerPoint. Testing this behavior verifies that your ingestion worker returns a 400 or 422 validation error instead of crashing.
10. Which open-source libraries and desktop programs are commonly used to parse or inspect .pptx fixtures?
Engineers typically validate and parse .pptx files using python-pptx, Apache POI XSLF, LibreOffice Impress, and Google Slides importer, each of which checks the specification rules defined by ECMA-376 and ISO/IEC 29500.
11. What are the primary software engineering and QA use cases for sample .pptx files?
Teams use deterministic .pptx fixtures for slide-to-PDF conversion workers, LMS lecture uploaders, and presentation thumbnail extractors, ensuring both small 10 KB unit tests and large 100 MB stress tests behave predictably.
12. How does in-browser Web Worker generation work for .pptx files up to 32 MB?
When you request a .pptx sample of 32 MB or less on /formats/pptx/, a background Web Worker runs our seeded generator off the main UI thread, builds the PPTX blob in memory, verifies its SHA-256 hash via Web Crypto, and triggers a local download.
13. How does Service Worker streaming create 50 MB to 1 GB .pptx files without running out of browser RAM?
For .pptx sizes above 32 MB on Chromium and Firefox, /sw.js intercepts the local /__gen/f/pptx/ request and emits 1 MB chunks through a ReadableStream directly to the browser download manager so the full file never resides in memory.
14. What is the published SHA-256 checksum for the 100kb (102,400-byte) .pptx sample file?
The deterministic sample-pptx-100kb.pptx fixture (102,400 bytes) has the SHA-256 digest 57d931827d83c96d3efcf8d5aeb2b0920323c0bf021c6d687f78d025e5405e12. Every build produces those exact bytes.
15. What is the exact byte count and SHA-256 hash of sample-pptx-500kb.pptx?
The file sample-pptx-500kb.pptx measures exactly 512,000 bytes and its SHA-256 checksum is 09565f648b879541a73683f5857b6f87f5782a6133a0555a0fd55095cd31f259.
16. What is the exact byte length and SHA-256 digest of the 5mb .pptx fixture (sample-pptx-5mb.pptx)?
The 5mb PPTX fixture (sample-pptx-5mb.pptx) is 5,242,880 bytes long with SHA-256 hash 315accd6aa402efd128890962f75a4ebfd84ee150a531222a68a278482713ae1.
17. How do I verify a downloaded .pptx sample on Linux, macOS, and Windows PowerShell?
Run sha256sum sample-pptx-10kb.pptx on Linux, shasum -a 256 sample-pptx-10kb.pptx on macOS, or Get-FileHash sample-pptx-10kb.pptx -Algorithm SHA256 in Windows PowerShell, and compare the output against /formats/pptx/.
18. Why can a browser report the wrong file.type when a user selects a renamed .pptx 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 .pptx uploads.
19. How do I attach a sample .pptx file to an automated upload test in Playwright?
Save the .pptx fixture from /formats/pptx/ into your test directory and call await page.locator('input[type="file"]').setInputFiles('fixtures/sample-pptx-10kb.pptx') before submitting the form.
20. How do I test .pptx file uploads in Cypress and Selenium WebDriver?
In Cypress, run cy.get('input[type="file"]').selectFile('cypress/fixtures/sample-pptx-10kb.pptx'). In Selenium WebDriver, pass the absolute filesystem path of the .pptx sample to WebElement.sendKeys().
21. Does HTTP gzip or Brotli transfer compression shrink a .pptx file over the network?
For PPTX (structured data), 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.
22. What happens if an API gateway or middleware reads a binary .pptx upload as a UTF-8 string?
Decoding binary .pptx 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 an OpenXML ZIP archive holding ppt/presentation.xml, individual slide trees under ppt/slides/slideN.xml, ppt/slideLayouts/, and DrawingML vector/text shapes measured in English Metric Units (1 inch = 914,400 EMUs).
23. How does the in-browser preview on /sample-files/pptx/10kb/ display .pptx contents safely?
When you click Preview file on a .pptx 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.
24. Why are Safari and iOS browsers capped at a lower maximum in-memory size for .pptx 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 .pptx files in RAM within a safe device ceiling (64 MB on iOS, 256 MB on desktop Safari).
25. Do the sample .pptx files on SampleTestFiles contain any real personal data or third-party copyrighted material?
No. Every .pptx 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/).

Part 2: Internal container layout, padding and byte structure

1. What specification or standard defines the .pptx format implemented by our generator?
Our PPTX generator follows ECMA-376 and ISO/IEC 29500, ensuring every header field and delimiter matches what python-pptx, Apache POI XSLF, LibreOffice Impress, and Google Slides importer expect.
2. How should a backend service store uploaded .pptx files in S3, object storage, or Google Cloud Storage?
Validate the .pptx 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/vnd.openxmlformats-officedocument.presentationml.presentation, and store the SHA-256 hex digest in object metadata.
3. Which size presets of .pptx are best for testing nginx client_max_body_size and AWS API Gateway limits?
Use the 1 MB and 2 MB .pptx presets on /formats/pptx/ to test nginx's default 1m client_max_body_size, and use the 10 MB and 15 MB .pptx presets to test AWS API Gateway's 10 MB payload boundary.
4. What does the PPTX (.pptx) specification table record for 'Extension'?
For .pptx files in the Presentations category, the 'Extension' attribute is defined as: .pptx. Parsers rely on this property when validating PPTX streams.
5. What does the PPTX (.pptx) specification table record for 'MIME type'?
For .pptx files in the Presentations category, the 'MIME type' attribute is defined as: application/vnd.openxmlformats-officedocument.presentationml.presentation. Parsers rely on this property when validating PPTX streams.
6. What does the PPTX (.pptx) specification table record for 'Standard'?
For .pptx files in the Presentations category, the 'Standard' attribute is defined as: ECMA-376 and ISO/IEC 29500. Parsers rely on this property when validating PPTX streams.
7. What does the PPTX (.pptx) specification table record for 'Container'?
For .pptx files in the Presentations category, the 'Container' attribute is defined as: ZIP (Open Packaging Conventions). Parsers rely on this property when validating PPTX streams.
8. What does the PPTX (.pptx) specification table record for 'Slide parts'?
For .pptx files in the Presentations category, the 'Slide parts' attribute is defined as: ppt/slides/slideN.xml. Parsers rely on this property when validating PPTX streams.
9. What does the PPTX (.pptx) specification table record for 'Macros'?
For .pptx files in the Presentations category, the 'Macros' attribute is defined as: Not allowed in .pptx; macro-enabled files use .pptm. Parsers rely on this property when validating PPTX streams.
10. What is inside the 100kb PPTX sample (sample-pptx-100kb.pptx) and what is its exact byte count?
The 100kb .pptx fixture (sample-pptx-100kb.pptx) contains an OpenXML ZIP archive holding ppt/presentation.xml, individual slide trees under ppt/slides/slideN.xml, ppt/slideLayouts/, and DrawingML vector/text shapes measured in English Metric Units (1 inch = 914,400 EMUs). Its exact length is 102,400 bytes (1 100kb binary units) and its verified SHA-256 checksum is 57d931827d83c96d3efcf8d5aeb2b0920323c0bf021c6d687f78d025e5405e12.
11. What is inside the 200kb PPTX sample (sample-pptx-200kb.pptx) and what is its exact byte count?
The 200kb .pptx fixture (sample-pptx-200kb.pptx) contains an OpenXML ZIP archive holding ppt/presentation.xml, individual slide trees under ppt/slides/slideN.xml, ppt/slideLayouts/, and DrawingML vector/text shapes measured in English Metric Units (1 inch = 914,400 EMUs). Its exact length is 204,800 bytes (1 200kb binary units) and its verified SHA-256 checksum is b4b69f545d37484e520e82d726376139ea44881cfe147c1762a731afe015f6ef.
12. What is inside the 500kb PPTX sample (sample-pptx-500kb.pptx) and what is its exact byte count?
The 500kb .pptx fixture (sample-pptx-500kb.pptx) contains an OpenXML ZIP archive holding ppt/presentation.xml, individual slide trees under ppt/slides/slideN.xml, ppt/slideLayouts/, and DrawingML vector/text shapes measured in English Metric Units (1 inch = 914,400 EMUs). Its exact length is 512,000 bytes (1 500kb binary units) and its verified SHA-256 checksum is 09565f648b879541a73683f5857b6f87f5782a6133a0555a0fd55095cd31f259.
13. What is inside the 1mb PPTX sample (sample-pptx-1mb.pptx) and what is its exact byte count?
The 1mb .pptx fixture (sample-pptx-1mb.pptx) contains an OpenXML ZIP archive holding ppt/presentation.xml, individual slide trees under ppt/slides/slideN.xml, ppt/slideLayouts/, and DrawingML vector/text shapes measured in English Metric Units (1 inch = 914,400 EMUs). Its exact length is 1,048,576 bytes (1 1mb binary units) and its verified SHA-256 checksum is 656580d064242556eb83dd8f7386a8f019ba2b4e508d9fd3e2f8c64340d12319.
14. What is inside the 2mb PPTX sample (sample-pptx-2mb.pptx) and what is its exact byte count?
The 2mb .pptx fixture (sample-pptx-2mb.pptx) contains an OpenXML ZIP archive holding ppt/presentation.xml, individual slide trees under ppt/slides/slideN.xml, ppt/slideLayouts/, and DrawingML vector/text shapes measured in English Metric Units (1 inch = 914,400 EMUs). Its exact length is 2,097,152 bytes (1 2mb binary units) and its verified SHA-256 checksum is c180c4b4a4944459f9205c87700ee68b8453a673352c4aebf1ac0909d088e64a.
15. What is inside the 5mb PPTX sample (sample-pptx-5mb.pptx) and what is its exact byte count?
The 5mb .pptx fixture (sample-pptx-5mb.pptx) contains an OpenXML ZIP archive holding ppt/presentation.xml, individual slide trees under ppt/slides/slideN.xml, ppt/slideLayouts/, and DrawingML vector/text shapes measured in English Metric Units (1 inch = 914,400 EMUs). Its exact length is 5,242,880 bytes (1 5mb binary units) and its verified SHA-256 checksum is 315accd6aa402efd128890962f75a4ebfd84ee150a531222a68a278482713ae1.
16. What is inside the 10mb PPTX sample (sample-pptx-10mb.pptx) and what is its exact byte count?
The 10mb .pptx fixture (sample-pptx-10mb.pptx) contains an OpenXML ZIP archive holding ppt/presentation.xml, individual slide trees under ppt/slides/slideN.xml, ppt/slideLayouts/, and DrawingML vector/text shapes measured in English Metric Units (1 inch = 914,400 EMUs). Its exact length is 10,485,760 bytes (1 10mb binary units) and its verified SHA-256 checksum is f040781e8735dfcc8b3eeb91a9c0720ca49c71ed2d9063077a4cd366c61decdd.
17. What is inside the 50kb PPTX sample (sample-pptx-50kb.pptx) and what is its exact byte count?
The 50kb .pptx fixture (sample-pptx-50kb.pptx) contains an OpenXML ZIP archive holding ppt/presentation.xml, individual slide trees under ppt/slides/slideN.xml, ppt/slideLayouts/, and DrawingML vector/text shapes measured in English Metric Units (1 inch = 914,400 EMUs). Its exact length is 51,200 bytes (1 50kb binary units) and its verified SHA-256 checksum is c3b563d231d20401b37f7934a66c6b905f6492f5812213260fa014f8fb7151e2.
18. What is inside the 3mb PPTX sample (sample-pptx-3mb.pptx) and what is its exact byte count?
The 3mb .pptx fixture (sample-pptx-3mb.pptx) contains an OpenXML ZIP archive holding ppt/presentation.xml, individual slide trees under ppt/slides/slideN.xml, ppt/slideLayouts/, and DrawingML vector/text shapes measured in English Metric Units (1 inch = 914,400 EMUs). Its exact length is 3,145,728 bytes (1 3mb binary units) and its verified SHA-256 checksum is 8adac09d174a2152b16e9c57e0eb5844712ca0b41a97873419399f0cb9f25112.
19. What is inside the 15mb PPTX sample (sample-pptx-15mb.pptx) and what is its exact byte count?
The 15mb .pptx fixture (sample-pptx-15mb.pptx) contains an OpenXML ZIP archive holding ppt/presentation.xml, individual slide trees under ppt/slides/slideN.xml, ppt/slideLayouts/, and DrawingML vector/text shapes measured in English Metric Units (1 inch = 914,400 EMUs). Its exact length is 15,728,640 bytes (1 15mb binary units) and its verified SHA-256 checksum is 07cf48362457af01cf4084ac07c4d85b6b97503c762813148e6db548503af150.
20. What is inside the 20mb PPTX sample (sample-pptx-20mb.pptx) and what is its exact byte count?
The 20mb .pptx fixture (sample-pptx-20mb.pptx) contains an OpenXML ZIP archive holding ppt/presentation.xml, individual slide trees under ppt/slides/slideN.xml, ppt/slideLayouts/, and DrawingML vector/text shapes measured in English Metric Units (1 inch = 914,400 EMUs). Its exact length is 20,971,520 bytes (1 20mb binary units) and its verified SHA-256 checksum is e2bdb7d45ed7425fe067708fa39907c9bc1c74157fa6e8f33b70263535b3ec4a.
21. What is inside the 25mb PPTX sample (sample-pptx-25mb.pptx) and what is its exact byte count?
The 25mb .pptx fixture (sample-pptx-25mb.pptx) contains an OpenXML ZIP archive holding ppt/presentation.xml, individual slide trees under ppt/slides/slideN.xml, ppt/slideLayouts/, and DrawingML vector/text shapes measured in English Metric Units (1 inch = 914,400 EMUs). Its exact length is 26,214,400 bytes (1 25mb binary units) and its verified SHA-256 checksum is 4991c9facb2224d061b814cf658bff15ea1b270e7acaae20cc9dc6d6b96bc7e2.
22. What is inside the 30mb PPTX sample (sample-pptx-30mb.pptx) and what is its exact byte count?
The 30mb .pptx fixture (sample-pptx-30mb.pptx) contains an OpenXML ZIP archive holding ppt/presentation.xml, individual slide trees under ppt/slides/slideN.xml, ppt/slideLayouts/, and DrawingML vector/text shapes measured in English Metric Units (1 inch = 914,400 EMUs). Its exact length is 31,457,280 bytes (1 30mb binary units) and its verified SHA-256 checksum is e940afaaae1afdf04edf5ca9e70145f694a52b19abf94add5a26b4f13ffd79f8.
23. What is inside the 50mb PPTX sample (sample-pptx-50mb.pptx) and what is its exact byte count?
The 50mb .pptx fixture (sample-pptx-50mb.pptx) contains an OpenXML ZIP archive holding ppt/presentation.xml, individual slide trees under ppt/slides/slideN.xml, ppt/slideLayouts/, and DrawingML vector/text shapes measured in English Metric Units (1 inch = 914,400 EMUs). Its exact length is 52,428,800 bytes (1 50mb binary units) and its verified SHA-256 checksum is 25bf5ddc20ab835c0f3c8fb3012503e96c0555caec96161093631a17931bebf7.
24. What is inside the 100mb PPTX sample (sample-pptx-100mb.pptx) and what is its exact byte count?
The 100mb .pptx fixture (sample-pptx-100mb.pptx) contains an OpenXML ZIP archive holding ppt/presentation.xml, individual slide trees under ppt/slides/slideN.xml, ppt/slideLayouts/, and DrawingML vector/text shapes measured in English Metric Units (1 inch = 914,400 EMUs). Its exact length is 104,857,600 bytes (1 100mb binary units) and its verified SHA-256 checksum is 7099e95d4f72ca5a31618dbf7d9c0181f57f60c8bf78ee7843f4c4cdd0932293.
25. What is the role of META-INF/container.xml in an EPUB 3 archive?
It is the mandatory bootstrap XML file that points the e-reader to the full path of the Package Document (such as OEBPS/content.opf) via the <rootfile full-path='...'/> element.

Part 3: In-browser generation, streaming and SHA-256 checksums

1. How does EPUB 3 handle table of contents navigation compared to EPUB 2?
EPUB 3 replaces the legacy EPUB 2 NCX (toc.ncx) file with an XHTML Navigation Document containing a <nav epub:type='toc'> ordered list.
2. Why must the mimetype file in an EPUB start at byte offset 30 with zero extra fields?
So that any file inspector can confirm 'application/epub+zip' at bytes 38–57 without parsing a variable-length ZIP extra field.
3. What leading byte signature or magic number identifies a EPUB (.epub) file at offset 0?
When a binary inspector reads the start of a .epub stream, it checks for 50 4B 03 04. In EPUB files, this signature is part of an IDPF/W3C Open Container Format (OCF) ZIP archive starting with an uncompressed 20-byte mimetype entry ('application/epub+zip' at offset 38), META-INF/container.xml, an OPF package document (.opf), and XHTML content chapters.
4. Which IANA MIME media type should an HTTP server return in Content-Type for .epub downloads?
Standardized delivery of EPUB uses application/epub+zip. If a server sends a generic type without X-Content-Type-Options: nosniff, browsers may misinterpret .epub payloads.
5. How does the internal structure of a EPUB (.epub) file organize headers and payload data?
Inside .epub, data is arranged as an IDPF/W3C Open Container Format (OCF) ZIP archive starting with an uncompressed 20-byte mimetype entry ('application/epub+zip' at offset 38), META-INF/container.xml, an OPF package document (.opf), and XHTML content chapters. Parsers such as Readium, epub.js, Calibre, Apple Books, Foliate, and EPUBCheck validate this layout before extracting application content.
6. What is the smallest valid byte size that the SampleTestFiles generator allows for .epub?
The minimum valid size for a generated EPUB fixture on this site is 3,072 bytes (with a step increment of 1 byte), because a smaller buffer cannot hold the required .epub header and trailer structures.
7. How does SampleTestFiles pad a .epub 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 .epub builder achieves exact byte targets by sizing XHTML chapter text and package resources inside the OCF ZIP container while preserving the uncompressed offset-30 mimetype header.
8. What happens when a .epub transfer is cut off halfway through uploading or downloading?
In EPUB streams, placing META-INF/container.xml before the mimetype entry in the ZIP stream causes EPUBCheck error PKG-006 (mimetype must be first at offset 30). Testing this behavior verifies that your ingestion worker returns a 400 or 422 validation error instead of crashing.
9. Which open-source libraries and desktop programs are commonly used to parse or inspect .epub fixtures?
Engineers typically validate and parse .epub files using Readium, epub.js, Calibre, Apple Books, Foliate, and EPUBCheck, each of which checks the specification rules defined by W3C EPUB 3.3.
10. What are the primary software engineering and QA use cases for sample .epub files?
Teams use deterministic .epub fixtures for e-reader ingestion pipelines, digital library catalogs, DRM-free book previewers, and accessibility screen-reader testing, ensuring both small 10 KB unit tests and large 100 MB stress tests behave predictably.
11. How does in-browser Web Worker generation work for .epub files up to 32 MB?
When you request a .epub sample of 32 MB or less on /formats/epub/, a background Web Worker runs our seeded generator off the main UI thread, builds the EPUB blob in memory, verifies its SHA-256 hash via Web Crypto, and triggers a local download.
12. How does Service Worker streaming create 50 MB to 1 GB .epub files without running out of browser RAM?
For .epub sizes above 32 MB on Chromium and Firefox, /sw.js intercepts the local /__gen/f/epub/ request and emits 1 MB chunks through a ReadableStream directly to the browser download manager so the full file never resides in memory.
13. What is the published SHA-256 checksum for the 10kb (10,240-byte) .epub sample file?
The deterministic sample-epub-10kb.epub fixture (10,240 bytes) has the SHA-256 digest 7aeb3a14b30fc59f9541188c802ab684623fce8b489b998d65fd0fe154010641. Every build produces those exact bytes.
14. What is the exact byte count and SHA-256 hash of sample-epub-1mb.epub?
The file sample-epub-1mb.epub measures exactly 1,048,576 bytes and its SHA-256 checksum is 8daca59d691bfadf8d23299336dd2d15d2f49f14333149eda98c8aa6c25717b9.
15. What is the exact byte length and SHA-256 digest of the 25kb .epub fixture (sample-epub-25kb.epub)?
The 25kb EPUB fixture (sample-epub-25kb.epub) is 25,600 bytes long with SHA-256 hash 88b6544ef8ee2a83921e1df1955a1cd39278959d27de861e590d99c543c2284f.
16. How do I verify a downloaded .epub sample on Linux, macOS, and Windows PowerShell?
Run sha256sum sample-epub-10kb.epub on Linux, shasum -a 256 sample-epub-10kb.epub on macOS, or Get-FileHash sample-epub-10kb.epub -Algorithm SHA256 in Windows PowerShell, and compare the output against /formats/epub/.
17. Why can a browser report the wrong file.type when a user selects a renamed .epub 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 .epub uploads.
18. How do I attach a sample .epub file to an automated upload test in Playwright?
Save the .epub fixture from /formats/epub/ into your test directory and call await page.locator('input[type="file"]').setInputFiles('fixtures/sample-epub-10kb.epub') before submitting the form.
19. How do I test .epub file uploads in Cypress and Selenium WebDriver?
In Cypress, run cy.get('input[type="file"]').selectFile('cypress/fixtures/sample-epub-10kb.epub'). In Selenium WebDriver, pass the absolute filesystem path of the .epub sample to WebElement.sendKeys().
20. Does HTTP gzip or Brotli transfer compression shrink a .epub file over the network?
For EPUB (structured data), 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.
21. What happens if an API gateway or middleware reads a binary .epub upload as a UTF-8 string?
Decoding binary .epub 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 an IDPF/W3C Open Container Format (OCF) ZIP archive starting with an uncompressed 20-byte mimetype entry ('application/epub+zip' at offset 38), META-INF/container.xml, an OPF package document (.opf), and XHTML content chapters.
22. How does the in-browser preview on /sample-files/epub/10kb/ display .epub contents safely?
When you click Preview file on a .epub 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.
23. Why are Safari and iOS browsers capped at a lower maximum in-memory size for .epub 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 .epub files in RAM within a safe device ceiling (64 MB on iOS, 256 MB on desktop Safari).
24. Do the sample .epub files on SampleTestFiles contain any real personal data or third-party copyrighted material?
No. Every .epub 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/).
25. What specification or standard defines the .epub format implemented by our generator?
Our EPUB generator follows W3C EPUB 3.3, ensuring every header field and delimiter matches what Readium, epub.js, Calibre, Apple Books, Foliate, and EPUBCheck expect.

Part 4: Parser libraries, edge cases and automated QA testing

1. How should a backend service store uploaded .epub files in S3, object storage, or Google Cloud Storage?
Validate the .epub 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/epub+zip, and store the SHA-256 hex digest in object metadata.
2. Which size presets of .epub are best for testing nginx client_max_body_size and AWS API Gateway limits?
Use the 1 MB and 2 MB .epub presets on /formats/epub/ to test nginx's default 1m client_max_body_size, and use the 10 MB and 15 MB .epub presets to test AWS API Gateway's 10 MB payload boundary.
3. What does the EPUB (.epub) specification table record for 'Extension'?
For .epub files in the Ebooks category, the 'Extension' attribute is defined as: .epub. Parsers rely on this property when validating EPUB streams.
4. What does the EPUB (.epub) specification table record for 'MIME type'?
For .epub files in the Ebooks category, the 'MIME type' attribute is defined as: application/epub+zip. Parsers rely on this property when validating EPUB streams.
5. What does the EPUB (.epub) specification table record for 'Standard'?
For .epub files in the Ebooks category, the 'Standard' attribute is defined as: W3C EPUB 3.3. Parsers rely on this property when validating EPUB streams.
6. What does the EPUB (.epub) specification table record for 'Container'?
For .epub files in the Ebooks category, the 'Container' attribute is defined as: ZIP (OCF). Parsers rely on this property when validating EPUB streams.
7. What does the EPUB (.epub) specification table record for 'Content'?
For .epub files in the Ebooks category, the 'Content' attribute is defined as: XHTML, CSS, SVG, images, fonts. Parsers rely on this property when validating EPUB streams.
8. What does the EPUB (.epub) specification table record for 'Navigation'?
For .epub files in the Ebooks category, the 'Navigation' attribute is defined as: XHTML nav document. Parsers rely on this property when validating EPUB streams.
9. What is inside the 10kb EPUB sample (sample-epub-10kb.epub) and what is its exact byte count?
The 10kb .epub fixture (sample-epub-10kb.epub) contains an IDPF/W3C Open Container Format (OCF) ZIP archive starting with an uncompressed 20-byte mimetype entry ('application/epub+zip' at offset 38), META-INF/container.xml, an OPF package document (.opf), and XHTML content chapters. Its exact length is 10,240 bytes (1 10kb binary units) and its verified SHA-256 checksum is 7aeb3a14b30fc59f9541188c802ab684623fce8b489b998d65fd0fe154010641.
10. What is inside the 100kb EPUB sample (sample-epub-100kb.epub) and what is its exact byte count?
The 100kb .epub fixture (sample-epub-100kb.epub) contains an IDPF/W3C Open Container Format (OCF) ZIP archive starting with an uncompressed 20-byte mimetype entry ('application/epub+zip' at offset 38), META-INF/container.xml, an OPF package document (.opf), and XHTML content chapters. Its exact length is 102,400 bytes (1 100kb binary units) and its verified SHA-256 checksum is e4160f484f7afd90596407a1d9408ff8907929b0037c6d6c2bf5ecfe2be1ff05.
11. What is inside the 1mb EPUB sample (sample-epub-1mb.epub) and what is its exact byte count?
The 1mb .epub fixture (sample-epub-1mb.epub) contains an IDPF/W3C Open Container Format (OCF) ZIP archive starting with an uncompressed 20-byte mimetype entry ('application/epub+zip' at offset 38), META-INF/container.xml, an OPF package document (.opf), and XHTML content chapters. Its exact length is 1,048,576 bytes (1 1mb binary units) and its verified SHA-256 checksum is 8daca59d691bfadf8d23299336dd2d15d2f49f14333149eda98c8aa6c25717b9.
12. What is inside the 5mb EPUB sample (sample-epub-5mb.epub) and what is its exact byte count?
The 5mb .epub fixture (sample-epub-5mb.epub) contains an IDPF/W3C Open Container Format (OCF) ZIP archive starting with an uncompressed 20-byte mimetype entry ('application/epub+zip' at offset 38), META-INF/container.xml, an OPF package document (.opf), and XHTML content chapters. Its exact length is 5,242,880 bytes (1 5mb binary units) and its verified SHA-256 checksum is f0031b98702ca72d0ee2562f7a53445a4246869b0b12ab18ff032a65eab30fda.
13. What is inside the 5kb EPUB sample (sample-epub-5kb.epub) and what is its exact byte count?
The 5kb .epub fixture (sample-epub-5kb.epub) contains an IDPF/W3C Open Container Format (OCF) ZIP archive starting with an uncompressed 20-byte mimetype entry ('application/epub+zip' at offset 38), META-INF/container.xml, an OPF package document (.opf), and XHTML content chapters. Its exact length is 5,120 bytes (1 5kb binary units) and its verified SHA-256 checksum is 17a35281c512500e4644078a6cfb2a9362678ad20291f9f4caca01ac992a129d.
14. What is inside the 25kb EPUB sample (sample-epub-25kb.epub) and what is its exact byte count?
The 25kb .epub fixture (sample-epub-25kb.epub) contains an IDPF/W3C Open Container Format (OCF) ZIP archive starting with an uncompressed 20-byte mimetype entry ('application/epub+zip' at offset 38), META-INF/container.xml, an OPF package document (.opf), and XHTML content chapters. Its exact length is 25,600 bytes (1 25kb binary units) and its verified SHA-256 checksum is 88b6544ef8ee2a83921e1df1955a1cd39278959d27de861e590d99c543c2284f.
15. What is inside the 50kb EPUB sample (sample-epub-50kb.epub) and what is its exact byte count?
The 50kb .epub fixture (sample-epub-50kb.epub) contains an IDPF/W3C Open Container Format (OCF) ZIP archive starting with an uncompressed 20-byte mimetype entry ('application/epub+zip' at offset 38), META-INF/container.xml, an OPF package document (.opf), and XHTML content chapters. Its exact length is 51,200 bytes (1 50kb binary units) and its verified SHA-256 checksum is adac53314c5338b3fc9229d37766f8efb3ef4dd173199610776706366f081980.
16. What is inside the 200kb EPUB sample (sample-epub-200kb.epub) and what is its exact byte count?
The 200kb .epub fixture (sample-epub-200kb.epub) contains an IDPF/W3C Open Container Format (OCF) ZIP archive starting with an uncompressed 20-byte mimetype entry ('application/epub+zip' at offset 38), META-INF/container.xml, an OPF package document (.opf), and XHTML content chapters. Its exact length is 204,800 bytes (1 200kb binary units) and its verified SHA-256 checksum is 0552d9eb1dbf7c6cb7c8f010d5b9e14f523ca124899426923af2b905fe349bdc.
17. What is inside the 500kb EPUB sample (sample-epub-500kb.epub) and what is its exact byte count?
The 500kb .epub fixture (sample-epub-500kb.epub) contains an IDPF/W3C Open Container Format (OCF) ZIP archive starting with an uncompressed 20-byte mimetype entry ('application/epub+zip' at offset 38), META-INF/container.xml, an OPF package document (.opf), and XHTML content chapters. Its exact length is 512,000 bytes (1 500kb binary units) and its verified SHA-256 checksum is 53cd3d54244345211b9d7faf850375ea614846f766222b6fe714e0d3be5571cb.
18. What is inside the 2mb EPUB sample (sample-epub-2mb.epub) and what is its exact byte count?
The 2mb .epub fixture (sample-epub-2mb.epub) contains an IDPF/W3C Open Container Format (OCF) ZIP archive starting with an uncompressed 20-byte mimetype entry ('application/epub+zip' at offset 38), META-INF/container.xml, an OPF package document (.opf), and XHTML content chapters. Its exact length is 2,097,152 bytes (1 2mb binary units) and its verified SHA-256 checksum is 23ee11a61bd1bbfa48e63ebd0688f187ec493848e6eb62a2fc13caa3abc1df77.
19. What is inside the 3mb EPUB sample (sample-epub-3mb.epub) and what is its exact byte count?
The 3mb .epub fixture (sample-epub-3mb.epub) contains an IDPF/W3C Open Container Format (OCF) ZIP archive starting with an uncompressed 20-byte mimetype entry ('application/epub+zip' at offset 38), META-INF/container.xml, an OPF package document (.opf), and XHTML content chapters. Its exact length is 3,145,728 bytes (1 3mb binary units) and its verified SHA-256 checksum is 8a6ff4ee551832431bc8a170129eae1551efb2fd67a788b76d35087a84678477.
20. What is inside the 10mb EPUB sample (sample-epub-10mb.epub) and what is its exact byte count?
The 10mb .epub fixture (sample-epub-10mb.epub) contains an IDPF/W3C Open Container Format (OCF) ZIP archive starting with an uncompressed 20-byte mimetype entry ('application/epub+zip' at offset 38), META-INF/container.xml, an OPF package document (.opf), and XHTML content chapters. Its exact length is 10,485,760 bytes (1 10mb binary units) and its verified SHA-256 checksum is e388ce0a299bba5e6dc475fd4d1ae5016cf3e5d70ae46caaf44ec16c5538bf4e.
21. What is inside the 15mb EPUB sample (sample-epub-15mb.epub) and what is its exact byte count?
The 15mb .epub fixture (sample-epub-15mb.epub) contains an IDPF/W3C Open Container Format (OCF) ZIP archive starting with an uncompressed 20-byte mimetype entry ('application/epub+zip' at offset 38), META-INF/container.xml, an OPF package document (.opf), and XHTML content chapters. Its exact length is 15,728,640 bytes (1 15mb binary units) and its verified SHA-256 checksum is 217a6157aedf5d5a34ae1eaccae4e6f5e215249dcad1996f9aca43ac3bf70859.
22. What is inside the 20mb EPUB sample (sample-epub-20mb.epub) and what is its exact byte count?
The 20mb .epub fixture (sample-epub-20mb.epub) contains an IDPF/W3C Open Container Format (OCF) ZIP archive starting with an uncompressed 20-byte mimetype entry ('application/epub+zip' at offset 38), META-INF/container.xml, an OPF package document (.opf), and XHTML content chapters. Its exact length is 20,971,520 bytes (1 20mb binary units) and its verified SHA-256 checksum is 80619f7e43d7e16a9a711aacceb2c700e5bd120a3fc7041d0644643c0b4fd405.
23. What is inside the 25mb EPUB sample (sample-epub-25mb.epub) and what is its exact byte count?
The 25mb .epub fixture (sample-epub-25mb.epub) contains an IDPF/W3C Open Container Format (OCF) ZIP archive starting with an uncompressed 20-byte mimetype entry ('application/epub+zip' at offset 38), META-INF/container.xml, an OPF package document (.opf), and XHTML content chapters. Its exact length is 26,214,400 bytes (1 25mb binary units) and its verified SHA-256 checksum is 4f762339d92d8caa939f05b8ee5f7e658d5970e5b1ba0e04abdf618873f0f26c.
24. What is inside the 30mb EPUB sample (sample-epub-30mb.epub) and what is its exact byte count?
The 30mb .epub fixture (sample-epub-30mb.epub) contains an IDPF/W3C Open Container Format (OCF) ZIP archive starting with an uncompressed 20-byte mimetype entry ('application/epub+zip' at offset 38), META-INF/container.xml, an OPF package document (.opf), and XHTML content chapters. Its exact length is 31,457,280 bytes (1 30mb binary units) and its verified SHA-256 checksum is 1052fe91248eda195b6d9ac65dc7b3a4b4537842d29ec3a3371b810fb76bfa7d.
25. What is inside the 50mb EPUB sample (sample-epub-50mb.epub) and what is its exact byte count?
The 50mb .epub fixture (sample-epub-50mb.epub) contains an IDPF/W3C Open Container Format (OCF) ZIP archive starting with an uncompressed 20-byte mimetype entry ('application/epub+zip' at offset 38), META-INF/container.xml, an OPF package document (.opf), and XHTML content chapters. Its exact length is 52,428,800 bytes (1 50mb binary units) and its verified SHA-256 checksum is 4dc0f53e375f1d09aa8407cad1077bead7ff18fbaaaad0edd733dccb03bf503d.

Explore more topic-based technical format references

Browse all 20 deep-dive Q&A guides on Testing guides or Frequently asked questions.