Hosted File Gateway: Overview

Updated Jul 26, 2026
Hosted File Gateway

Hosted File Gateway: Overview

The Hosted File Gateway is an SFTP and FTPS endpoint that DataMagik runs for you. Your trading partners — and your own systems — connect into it and drop files. Each file lands in your own storage, is routed by folder to a handler, and every transfer and connection attempt is recorded.

Find it at Extensions > File Gateway.

This is not the same thing as a file connector

These two are confused constantly, so it is worth being precise about the difference before anything else. They point in opposite directions.

File connectorHosted file gateway
Who connects to whomDataMagik dials out to a server somebody else runsSomebody else dials in to a server DataMagik runs
Whose credentialsTheirs. You hold and store them.Yours. You issue them a login.
Whose firewallTheirs must let you inYours — already open, it is a hosted endpoint
How a file is noticedPolling on a scheduleThe moment the upload closes
Good forA partner or system that already runs a server and will not changeA partner with nothing to offer but a client, and any partner you would rather not hold credentials for
WhereConnectors > File ConnectorsExtensions > File Gateway
A rule of thumb. If the sentence is "they will put a file on their server and we need to go and get it", you want a connector. If it is "where should we tell them to send it?", you want the gateway.

They are complementary, and many customers run both — a connector for the ERP on the plant floor, the gateway for the trading partners on the internet.

What happens to a file

partner connects (SFTP or FTPS)
  → authenticates as a PRINCIPAL — which fixes the tenant and the storage root
  → uploads into /inbound/<folder>
  → the bytes stream into YOUR storage bucket
  → a transfer receipt is written
  → duplicate check on the file's SHA-256
  → the folder is matched to a ROUTE, which names a HANDLER
  → the handler runs: edi | script | ocr | app_load | store
  → the outcome is recorded on the transfer

The bytes are stored before anything is decided about them, so a misconfigured route never costs you a partner's file — the transfer is recorded as unrouted and can be replayed once you fix the rule.

The five handlers

HandlerWhat it does with the file
EDIRuns the full inbound EDI pipeline — parse, partner, map, validate, route, acknowledge.
ScriptRuns one of your scripts with the file in its context.
OCR extractionReads the document against an extraction profile and keeps the fields.
Load into a lookup tableImports a CSV or JSON as lookup rows, upserted.
Store onlyKeeps the file. A legitimate choice when something else will collect it.

Two directions

/inbound is where partners write. /outbound is where they read — documents you have staged for them to collect, including EDI documents.

Writes are confined to /inbound, reads to /outbound. A partner that could write into its own collection folder could plant a file for itself to collect — and one an operator would read as something you produced.

Before you start

  • Storage is required. Files rest in your bucket, so the gateway needs your company storage configured. There is no platform fallback — see Storage & Data Retention.
  • Permissions. Reading needs Builder or Viewer. Managing principals and routes needs DataMagik - Builder. Anything touching keys, certificates or server identity needs Builder or DataMagik - Security.
Next: Connection Details for the host, ports and a first-connection test; Principals and Logins to create a login.
Was this page helpful?