Hi everyone,
Short version: how do you upload binary data into a MySQL blob field in such a way that it can be read by any application?
Long version:
I've been struggling with the problem of putting files into database BLOB fields. (MySQL and Database Connectivity Toolkit).
I was initially building a query string and executing the query but was finding that certain binary characters were causing failures (end of string terminators, etc...) So, a working solution was to encode the binary string, and that worked fine, although bloated the dB a fair bit. I could decode in LabVIEW and then save the file as needed.
Now, the customer wants to be able to save the files using other apps, including the MySQL Query Browser, so an encoded file is no good.
I found using a parametrized query allows me to put the unencoded string into the dB, but it appends a 4-byte length at the front of the BLOB before it inserts it into the dB. Some apps ignore these 4-bytes (such as .pdf) but most do not.
A related thread on NI discussion forums:
http://forums.ni.com/ni/board/message?boar...ssage.id=354361 has no solution, and my support ticket at NI has been ongoing without answer for a while.
Thanks,
Ben