I have file data stored in my database as varbinary. Sometimes the files are images. I want my image component to display the images, but I think I’m having an issue converting from the varbinary data to base64. I can convert the varbinary data to base 64, but the image component does not display.
Here is the image I uploaded using the perspective upload component, and then pushed to the db as varbinary:
Here’s the script I used to transform the varbinary data to base64 data:
Another Thing I’ve noticed is that for some reason my ignition transforms the file_bytes from the native ASCII encoded data into an integer array when I try and pull the data out of the database?
I tried a script that convereted each byte of the array to an unsigned integer by %256 for each element. That didnt seem to actually make the image component render the base64 encoded data though. I can download the byte data from SQL and open the file and it is correct.
Is the main crux of the problem that I first need to convert each element in the list to unisgned data? I tried that before and it didn’t seem to completely solve the problem.