Briyah SDK - v2.0.18
    Preparing search index...

    Function detectDocumentType

    • Decides what a file is from its contents, using the name only to break ties.

      .docx and .xlsx are both ZIP archives, so their magic bytes are identical; the archive's entries are what tell them apart. The extension alone is never trusted over the contents — a renamed file is refused rather than misread.

      Parameters

      • bytes: Uint8Array
      • fileName: string

      Returns DocumentTypeDetection