How to import text encoded binary to an entity from CSV?
0
We are working through importing data from some legacy systems, which includes storing binary data in a column in SQL Server. As such, when importing the CSV the data comes across as text encoded binary, in a format seen below: "0xFFD8FFE000104A46494600010100000100010000FFFE00...." I am trying to import this text encoded binary to an entity that is a generalization of System.FileAttachment. I am doing so by using the CommunityCommons module and using their StringToFile action. However, this seems to result in broken files. When debugging, I can see that the length of the stored content is the same length as the text encoded binary, so it appears to have just copied over the text. My question then becomes: How do I read text encoded binary and save it to a FileAttachment entity? This really shouldn't be difficult, there should be an action for BinaryToText and TextToBinary that encodes/decodes between the two, yet all I can seem to find on various Google searches is everyone referring to use the Base64 Encode/Decode functions from COmmunityCommons, which obviously do not apply here since this is not base64 encoded but just text encoded with UTF-8.
asked
Alex Stump
1 answers
1
Seems the best solution is to just have the SQL query cast the binary column as base64, then import that. I could not figure out a way to create a custom java action to take the input string and return a base64 encoded string of the underlying binary data.