Components | All | New | MacOS | Windows | Linux | iOS | ||||
Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old |
Container.GetBase64
Returns the base 64 encoded value of the container.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
Container | 1.4 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
Parameters
Parameter | Description | Example | Flags |
---|---|---|---|
Container | The container field or value to inspect. | MyTable::MyContainerField | |
Name or Index | either the name of the Type or it's index. Version 12.2 returns main item if this parameter is empty. |
0 | Optional |
Result
Returns data or error.
Description
Returns the base 64 encoded value of the container.You must tell the plug-in which of the types in the container field you want to use. You can use either it's name (JPEG, TIFF, PNGf etc) or it's index. The index is from 0 to the count of types -1 You can use Container.GetCount to return the count of types in the container.
You can pass index zero and get data form references file in case container is a file reference.
See also Container.DecodeFromBase64.
Examples
Get PNG image in Container as Base64:
MBS( "Container.GetBase64"; MyTable::MyContainerField; "PNGf" )
Get JPEG image in Container as Base64:
MBS( "Container.GetBase64"; MyTable::MyContainerField; "JPEG" )
From PDF in Base64 to a PNG in Base64:
# decode some PDF in base64 text
Set Variable [$PDFData; Value:MBS( "Container.DecodeFromBase64"; "PDF"; PDF_ToPNG::base64_PDF; "test.pdf" )]
# render first page to a picture in PNG format
Set Variable [$PNGData; Value:MBS( "PDFKit.GetPDFPageImage"; $PDFData; 0; "PNG"; "test.png"; 150; 1; 0)]
# encode PNG as Base64
Set Variable [$EncodedPNG; Value:MBS( "Container.GetBase64"; $PNGData; "PNGf" )]
# store text in a field
Set Field [PDF_ToPNG::Convert_text; $EncodedPNG]
Get Container as Base64:
MBS( "Container.GetBase64"; MyTable::MyContainerField )
See also
- Container.DecodeFromBase64
- Container.GetCount
- Container.GetName
- Container.GetSize
- Container.GetText
- Container.GetType
- Container.GetTypes
- PDFKit.GetPDFPageImage
Release notes
- Version 12.3
- Fixed Container.GetBase64 function to work without error and only container parameter.
- Version 12.2
- Changed Container.GetBase64 and Container.GetHex to return main container item if no index is passed.
Example Databases
Blog Entries
- MBS FileMaker Plugin, version 12.3pr5
- MBS FileMaker Plugin, version 12.2pr3
- Custom Filemaker Function: MBS_HTML_EncodeImage_JPG
This function checks for a license.
Created 18th August 2014, last changed 16th April 2022