Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server (Not)   Client   Old   Guides   Examples
New in version: 6.1   6.2   6.3   6.4   6.5   7.0   7.1   7.2   7.3   7.4    Statistic  

Container.DecodeFromBase64

Decodes data from base64 text into a container value.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
Container 4.4 Yes Yes Yes Yes Yes

MBS( "Container.DecodeFromBase64"; type; text { ; filename; DontRenderPreview } )

Parameters

Parameter Description Example value
type The type to return. Can be JPEG, TIFF, GIF, PNG, PDF or File. "JPEG"
text The text to process.
filename Optional
If filter is container, this defines the file name to use.
"test.txt"
DontRenderPreview Optional
Pass 1 to not create a JPEG with preview of first page as part of the container. (only for returning PDF)
0

Result

Returns container or error.

Description

Decodes data from base64 text into a container value.
See also Container.GetBase64.

Examples

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]

See also

Example Databases


Container.Compress   -   Container.DecodeFromHex

Feedback: Report problem or ask question.




Links
MBS FileMaker tutorial videos