Components Crossplatform Mac & Win Server Client Old Deprecated Guides Examples Videos
New in version: 9.1 9.2 9.3 9.4 9.5 10.0 10.1 10.2 10.3 10.4 Statistic
Reads a file with the given path.
|Component||Version||macOS||Windows||Server||FileMaker Cloud||FileMaker iOS SDK|
|FilePath||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.||"test.txt"|
|mode||Can be base64 to encode data first to base64 encoding. Or can be Hex to encode to hex encoding. If filter is "container", the result is returned as a container with a FILE stream inside. Version 5.3 supports filter "auto" to auto detect the type of container.
Added Base64URL as option for plugin version 10.3.
|filename||If filter is container, this defines the file name to use.||"test.txt"||Optional|
Returns container value or error.
DescriptionReads a file with the given path.
Reads the data in the file and returns as text with native encoding. This may truncate the string at the first null byte.
You can optionally define a mode like base64 or Hex to read any bytes including null bytes.
See also Text.ReadTextFile for reading text files with specific encoding.
Reading files over 1 GB is not supported.
Added new modes with version 5.3: auto, compressed, pdf, png, jpg, tif, gif, bmp or psd.
For reading simple text files, please use Text.ReadTextFile.
See also Files.ReadJPEG, Files.ReadPDF, Files.ReadPNG, Text.ReadTextFile and RichText.ReadFile.
For PDF content: If you have a DynaPDF Pro license and DynaPDF functions initialized, this function can add previews for the PDF file on Windows and Linux. For MacOS, we make them with PDFKit.
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 file with some data:
Read file with some data and encode base64:
Read as compressed container:
Read file on Server:
- CURL/WebServices/WeatherBit.io test
- Drag and Drop/DragTest Popover
- Drag and Drop/DragTest
- Drag and Drop/for Mac/DragTest multiple picture files
- Mac and iOS/Machine Learning/Core ML Photos
- Mac only/ImageCapture/Camera Import
- MBS FileMaker Plugin, version 10.3pr1
- FileMaker 18 File Script Steps vs. BinaryFile functions
- Adding Drag and Drop receiver to a layout
- [ANN] MBS FileMaker Plugin 5.3 for OS X/Windows
- MBS FileMaker Plugin, version 5.3pr4
- Compressed Containers
- MBS Filemaker Plugin, version 4.4pr6
- MBS Filemaker Plugin, version 3.5pr7
- Version 10.3
Created 18th August 2014, last changed 22nd May 2020
Feedback: Report problem or ask question.
MBS Xojo blog