Adapter: Local File (mounted volume)
Read and write files in a folder mounted into the engine (Mirth File Reader/Writer, FILE scheme).
Purpose
Read, write, list, move and delete files in a folder on a volume mounted into the engine container: the FILE scheme of a Mirth File Reader or File Writer. Pick files up from it with the file pickup trigger.
Auth
- No login: the engine's own file access.
- The operator decides which folders any profile may use.
FILE_ADAPTER_ROOTSlists them (comma-separated absolute paths); the Helm chart sets it fromfileAdapter.mounts, which also mounts each volume. With no roots set, every read and write is refused. baseDirmust be one of those folders or inside one, after symlinks are resolved. A profile outside them saves with a warning, and every step through it is refused until the operator allows the folder.
Settings
Auth is none. Dotted names are fields inside an object setting. Secret settings are encrypted at rest, never returned by a read, and shown masked in the console and in exports; their defaults are not shown.
| Setting | Type | Required | Default | Secret | Description |
|---|---|---|---|---|---|
baseDir | string | Yes | No | Absolute folder on a mounted volume; it must be inside one of the folders the operator lists in FILE_ADAPTER_ROOTS. | |
maxFileBytes | number | No | 52428800 | No | Largest file a read step loads into memory (bytes). |
uploadMode | enum: temp-rename, direct | No | temp-rename | No | temp-rename writes a hidden .part file then renames it; direct writes the final name. |
writeMode | enum: overwrite, append, error-if-exists | No | overwrite | No | overwrite replaces an existing file; append adds to it (written directly); error-if-exists fails the step. |
createDirs | boolean | No | false | No | Create the parent directory before writing. |
Actions
A trailing ? marks an optional step parameter. A message can supply only the keys in the last column; everything else comes from the step.
| Action | What it does | Step parameters | Keys a message may supply |
|---|---|---|---|
download | Read a file from the folder. | remotePath, encoding? | None |
upload | Write a file to the folder. | remotePath, filenamePattern?, content? | content |
list | List files in a directory. | remotePath? | None |
delete | Delete a file. | remotePath | None |
rename | Move (rename) a file. | fromPath, toPath | None |
Minimal example
The smallest profile the engine accepts: the required settings only, with synthetic values. Create it with POST /api/adapter-profiles, then test it with POST /api/adapter-profiles/{id}/test.
{
"name": "Local File (mounted volume) (example)",
"adapterType": "file",
"config": {
"baseDir": "/mnt/medhook/inbound"
}
}Limits
- Every path is relative to
baseDir(/isbaseDiritself). A.or..segment, a backslash or a NUL byte is refused, not normalised. A symlinked folder that leads out ofbaseDiris refused, and a symlinked file is never opened (O_NOFOLLOW). - Every read, write, move, delete and listing goes through its folder opened without following symlinks and checked again after the open (on Linux through
/proc/self/fd), so a folder swapped for a symlink while the engine works is refused, not followed. - A file with more than one hard link is not read: a hard link could make a file outside
baseDirappear inside it. - Writes go to a hidden
.partfile in the same folder and are renamed onto the final name by default (uploadMode), so a reader never sees half a file.writeModepicks overwrite, append (written directly) or fail when the file exists. - A move never replaces an existing file. On a volume without hard links it checks for the target, then renames.
- Error messages name the call and the error code, never the host path.
- Reads load the whole file into memory, up to
maxFileBytes.