Skip to main content

How it works

The File connector indexes files that an admin uploads to Onyx. It supports these file types:
  • Text: .txt, .md, .mdx, .conf, .log, .json, .csv, .tsv, .xml, .yml, .yaml, .sql
  • Documents: .pdf, .docx, .pptx, .xlsx, .xlsm, .eml, .epub, .html
  • Images: .png, .jpg, .jpeg, .webp
You can also upload a .zip that contains these files. Onyx skips files of other types inside the zip. You can add metadata to a file, such as a link, the document owners, and the update time. Onyx uses this metadata in search and in answers. Permission sync does not apply to uploaded files. Everyone who can see the connector’s documents in Onyx can see every file.

Adding metadata

Put one metadata line at the top of a text file. Use one of these formats:
  • #ONYX_METADATA={"link": "<LINK>"}
  • <!-- ONYX_METADATA={"link": "<LINK>"} -->
ONYX_METADATA= is followed by a JSON object. Onyx reads these keys:
  • link
  • title
  • file_display_name
  • primary_owners
  • secondary_owners
  • doc_updated_at
Any other key becomes a tag. Users can filter a search or a chat by tag, so that Onyx reads only documents with that tag. Example:
Full file example:
Use this to bring in content from pages and internal tools that Onyx cannot crawl. Export the content with a tool that can read it, add the metadata line, and upload the files.

Metadata for a zip file

To set metadata for the files in a .zip, add a .onyx_metadata.json file to the root of the zip. The file holds one entry per file, matched by filename:
status in this example is a tag. Add any key and value you want as a tag.

Setting up

Authorization

The File connector needs no external account. Any admin who can manage connectors can upload files.

Indexing

1

Upload files

In the Onyx admin panel, go to Connectors and select File. Under Files, drag in or select one or more files or a .zip.File connector upload form in Onyx
2

Choose document access

Under Document Access, select who can see the files. Specific Groups is available on the Business and Enterprise plans and on Onyx Cloud. Then click Create Connector.

Adding or removing files later

Open the connector from Connectors and click Edit in the Files section to add or remove files. Onyx indexes the new files and removes the deleted ones.