Nodes/ComfyUI-ZMongo/06 Upload Document File
ComfyUI Node

06 Upload Document File

Ship the raw file itself to the backend, not just its text

By CentralFloridaAttorney·Created 5 months ago·Updated 2 months ago· 1
06 Upload Document File
  • session
  • file_path_link
  • json
  • document_id
  • document_id_link
  • filename
  • filename_link
  • size_bytes
  • success
  • refresh
  • document_ids
  • filenames
  • selectable_items
  • indexed_items
  • item_count
file_path
case_id
metadata_json{}
document_prefix/documents
known_text
refresh_token

Ingest extracts text locally and saves the words. This node saves the file itself. "06 Upload Document File" reads a local file, base64-encodes it, and uploads the whole thing to the ZMongo backend as a document record - bytes included, case_id and metadata attached. The distinction matters: if your pipeline needs to preserve the original PDF or DOCX (for legal-style document handling, archiving, or OCR on the server), you want Upload, not Ingest. Ingest keeps the text; Upload keeps the document.

How it works

It reads the file at file_path (or the file_path_link from "06 Document File Browser"), base64-encodes it, and POSTs /api/upload with the filename, content type, encoded data, an optional case_id, metadata_json, and - usefully - a known_text field where you can attach text you already have, so a record can carry both the binary and its transcription in one place. There's a default 64 MB upload cap (ZMONGO_DOCUMENT_NODE_MAX_UPLOAD_BYTES), and case_id is this pack's nod to organizing documents into cases/collections of related files.

Outputs: document_id and document_id_link (the record's identity for later), filename / filename_link, size_bytes (how much was actually uploaded), success, plus document_ids and filenames list tails and the selectable tail.

Install

cd ComfyUI/custom_nodes
git clone https://github.com/CentralFloridaAttorney/ComfyUI-ZMongo

Restart ComfyUI, or install "ComfyUI-ZMongo" via ComfyUI Manager. Unlike Ingest, this node has no heavy extraction dependencies - it just ships bytes.

Where people get burned

The same "machine running ComfyUI" rule as the File Browser, and the node is unrelenting about it: the file must exist on the ComfyUI box, not on your laptop. If you're pointing at a path you can see in your browser but ComfyUI runs elsewhere, it will fail with "file not found" every time. Also - and the checks in the error payload call this out - connect file_path_link from the File Browser, not browser_root or a directory path. Directories are rejected on purpose; it wants a real file.

Second, the upload is to the hosted backend. In pure Local File Store mode there's no /api/upload route, so this node's natural home is the hosted ZMongo/BPA setup where server-side processing (including OCR) runs. If you're entirely local and just want text searchable, Ingest is the lighter tool. If you're building the hosted-document pipeline this pack is clearly aimed at, Upload + Queue OCR is the intended pairing - the server keeps the file and can run OCR on it later.

And keep the 64 MB cap in mind for big files. Over it, the upload fails - split the file or process it elsewhere.

CategoryZMongo/03 Documents

Inputs (8)

NameTypeDefaultDescription
sessionZMONGO_API_SESSION
file_pathSTRING
case_idSTRING
metadata_jsonSTRING{}
document_prefixSTRING/documents
file_path_linkopt*
known_textoptSTRING
refresh_tokenoptSTRING

Outputs (13)

NameTypeDescription
jsonSTRING
document_idSTRING
document_id_linkZMONGO_DOCUMENT_ID
filenameSTRING
filename_linkZMONGO_FILENAME
size_bytesINT
successBOOLEAN
refreshSTRING
document_ids*
filenames*
selectable_items*
indexed_itemsSTRING
item_countINT