🚀 Welcome to MDriven Learn –  MDriven is now on Discord!  Don’t miss the latest Release Notes.
OCLOperators SaveToFile
Created by Stephanie on 2025-01-09 · Last edited by Vale.buyondo on 2026-02-14.

SaveToFile is an Executable Action Language (EAL) operator used to write data—either a string or a binary blob—directly to a file on the hard drive of the machine executing the logic.

Syntax

selfVM.SaveToFile(filename, data)

  • filename: A String representing the full path.
  • data: The content to save, typically a String (for CSV/JSON/XML) or a Blob (for images/PDFs).

Example

selfVM.SaveToFile('C:/Exports/' + vCurrent_Customer.Name + '.png', vCurrent_Customer.ProfilePicture)

Technical Notes

  • Execution Location: In a web environment (Turnkey), the file is saved to the Server's disk, not the user's local "Downloads" folder.
  • Permissions: The MDriven Server service account must have "Write" permissions to the destination folder.
  • String Parsing: Ending a path string with a backslash (e.g., 'C:\Temp\') causes a syntax error because the OCL parser thinks you are escaping the closing quote. Always use forward slashes (/) for paths in EAL.
  • Overwrite Behavior: The operator will overwrite an existing file of the same name without prompting for confirmation.