Am trying to display an image in a web viewer.
Image::Base64Encoded is a calculation field Base64Encode(Image)
Browse mode is not displaying the image.
Any suggestions how to fix this?
You need encoded text there, don't decode it. Try
Substitute ( Image::base64Encoded ; [ Char(10) ; "" ] ; [ Char(13) ; "" ] )
Thank you. It works.
But then whats the role of Base64Decode function?
When an web site has encoded image in html source like just you did now, you get the image into container field using Decode function.
They do opposite things, so rarely used in one calculation. Here is one FileMaker Custom Function:RenameContainterFile ( ~FQFN ; ~NewFileName )
I use Base 64 to pass photographs as a parameter to another file for remote syncing since trying to send a container field didn't work. The receiving script has to decode it and store it in a container field.
This simplifies everything and makes a sync script easy to work with using GO.
There are a number of various uses for Base 64. What it does is convert binary data into ASCII text characters. This goes back to the days when binary 8 bit files needed transferred through 7 bit processes, the most common being email. How would you get an 8 bit graphic to email if the email only does 7 bits. You would loose one of your bits of information of the packet, which is no good. So you encode it in Base 64 so that it is 7 bit and at the other end decode it back to the binary. Wikipedia has a good article on how it works, but the article is short in explaining the history. A more interesting read on the history of decoding is at History of Decoding
I found an excellent article on Weetbicks recently about using these two functions in regards to interactive container data.
Retrieving data ...