|Mac & Win
Reads a file with the given path.
|The native file path.
Something like "/Users/cs/desktop/test.txt" on Mac and "C:\Programs\Data\test.txt" on Windows. Files without path end in the root directory on Mac.
|If missing or "auto", the plugin will try to detect type by file name extension.
If filter is "container", the result is returned as a container with a FILE stream inside.
The type can be specific here like PDF, JPEG, TIFF, GIF, BMP or PSD to return as image container. Or "compressed" to return a compressed container.
|If result is container, this defines the file name to use.
Returns container value or error.
DescriptionReads a file with the given path.
Reads the data in the file and returns as container.
See also Text.ReadTextFile for reading text files with specific encoding.
For reading simple text files, please use Text.ReadTextFile.
See also Files.ReadFile, Files.ReadJPEG, Files.ReadPDF, Files.ReadPNG, Text.ReadTextFile and RichText.ReadFile.
This function is optimized for FM 14 and newer to stream file content when using auto mode. This allows to import up to 4 GB of data in small chunks.
FileMaker may decide to create a preview when the plugin passes back the data to FileMaker. If FileMaker on macOS creates a preview for a PDF may take some time and leak memory.
This function reads the file data into memory and does not define how FileMaker stores it. This is defined by which field it is later assigned to. And the field options define whether this container value is stored internally or externally.
This function requires a native path. Use Path.FileMakerPathToNativePath to convert a FileMaker path to a native path if required. If you like to have the user choose the path, you can use FileDialog functions.
For Server be aware that server has limited permissions and may not be able to access all files on a computer.
Read image file:
Read image file with error checking:
Save as PDF and import it to a field:
Import file on Server on Windows:
Import all files in a folder:
- Version 12.0
- Fixed Container.ReadFile to read empty files.
- Version 11.3
- Fixed a memory leak in Container.ReadFile function when used on server and FileMaker creates a PDF preview.
- DynaPDF/Extract and analyze images
- DynaPDF/PDF Library
- iOS/Examples/iOS Photo Picker
- Mac and iOS/Contacts/Contacts
- Mac and iOS/PDFKit/PDFKit Print Documents
- Mac only/ImageCapture/ImageCapture
- Utility functions/Trigger Script on Plugin Error
- Win Only/WIA Scan
- PhotoPicker for iOS with FileMaker iOS SDK
- Convert Office Files in FileMaker
- Windows Photo Acquire for FileMaker
- Combined Components with MBS FileMaker Plugin
- Save PDF to container in FileMaker
- Read HEIC or HEIF image files in FileMaker
- FileMaker 18 File Script Steps vs. BinaryFile functions
- Comparing Base Elements Plugin to MBS FileMaker Plugin
- ImageCapture functions for Mac OS X
This function is free to use.
Created 6th September 2016, last changed 23th December 2023