Please enable JavaScript to view this site.

Altova MapForce 2021 Professional Edition

This function returns the content of the specified file as a BLOB (binary large object) of type xs:base64Binary. Note that even though the data type is called "base64Binary", the internal representation is just a BLOB. Only when you map the function's result to an XML node of type xs:base64Binary will it actually be base64-encoded. You could also map the function's result to xs:hexBinary, to a database blob, or to a binary field in a Protocol Buffers structure.

mf-func-read-binary-file

To read a binary file into a mapping, supply its path as input to the filepath argument. If the filepath is relative, then MapForce will look for the file in the same directory as the mapping. The must-exist argument is optional; if the file cannot be opened and this parameter is true, the mapping throws an error. If the file cannot be opened and this parameter is false, an empty binary is returned.

 

Languages

Built-in.

 

Parameters

Name

Type

Description

filepath

xs:string

The file path.

must-exist

xs:boolean

Optional parameter. If the file cannot be opened and this parameter is true, the mapping throws an error. If the file cannot be opened and this parameter is false, an empty binary is returned.

 

The default value is true.

 

Example

See Example: Read Binary Files.

© 2020 Altova GmbH