| Previous | Next |
| STG_E_ABNORMALAPIEXIT | STG_E_INVALIDNAME |
STG_E_INVALIDHEADER
Usually a container-identification problem
STG_E_INVALIDHEADER means Structured Storage rejected the file as a valid Compound File Binary Format container at the header stage. The first possibility is simple: the application was given the wrong file type, such as a modern Office ZIP package, plain text, HTML error page, zero-byte placeholder, or a file renamed with a legacy extension. The other possibility is damage to the compound-file header caused by truncation, incomplete download, overwrite, or media failure.
The CFB specification defines a fixed header and format fields that tell a reader how to interpret sectors and allocation data. A matching filename extension is not evidence that those bytes are intact. This is why the same error can appear for a completely unrelated file and for a formerly valid document whose beginning was damaged.
Safe checks before repair
- Verify file size, origin, and signature; compare against a known-good copy when available.
- Do not rename a modern OOXML file to a legacy extension in an attempt to make a Structured Storage reader accept it.
- Use a read-only identifier or independent parser to confirm whether the file is CFB before modifying it.
- If the file came from a download or synchronization client, retrieve a clean source copy rather than repeatedly opening the same partial file.
References
- Microsoft: MS-CFB header and format
- Apache POI: OLE 2/POIFS support
- olefile: overview of OLE compound files
Looking for a different code? Search another status or error code.
