I have a jpeg file in FileMaker that I'm trying to get over to a MySQL database via ODBC. I know that you can't connect to blobs easily, so I'm using the FileMaker base64_encode calculation to convert it to a text string. I'm using a FileMaker script that goes to a layout for the external table and adds a new record with the base64 encoded text. Consistently, I'm losing exactly half of the characters. When I convert the string back to an image on the MySQL server, I get half of the jpeg image. The "odd" thing (which may not be odd at all) is that I get the first half of the picture which suggests to me that its dropping the second half of the text in the file (if the jpeg data is progressive). I've tried this with multiple jpeg files of different sizes, and I always lose half of the characters and thus half the picture. As a control, within FileMaker I've taken the jpeg, base64 encoded it, then base64 decoded it and I get the full image.
On a hunch, I changed the MySQL character set from UTF-8 to UTF-16 for both the database and the table thinking that the character set was the issue, but I'm still getting the same results. The MySQL field type is a longtext. The string is in a variable in FileMaker.
I'm certain this is probably obvious to someone that's done this. If this is a character set issue, then I'm not quite certain how else to address it.
Help would be greatly appreciated.