cancel
Showing results for 
Search instead for 
Did you mean: 

Read Image file from BLOB.

former_member202208
Active Participant
0 Kudos

Hi All,

I am trying to load data from BLOB data from database and save the image file.

SQL to insert data:

INSERT INTO BLOBTest (BLOBName, BLOBData)

SELECT 'First test file', BulkColumn FROM OPENROWSET(Bulk 'C:\Inbound\logo.jpg', SINGLE_BLOB) AS BLOB

I am using the following 'SELECT top 1 BLOBData from BLOBTest' to get the data and setting the value to 'Image Saver' action. The image file is saved to the specified path, but the image is not opening.

I get "Image is damaged, corrupted or is too large message. The file is around 40 KB."

Am i missing something.

Any help would be highly appreciated.

MII Version: 14.0 SP 3

Thanks,

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member202228
Active Participant
0 Kudos

I'd avoid saving images in the DB. The binary formats can return characters which need to be escaped while processing them via XML file transfers. Some control characters, are not even allowed in an XML format. You can save images in the NetWeaver web-space, and put only the link to them in the database. You don't need to publish the images right away, but you can easily use them from there.

former_member202208
Active Participant
0 Kudos

Hi Paul,

One of our customer has already stored images in DB and we need to use the same.

Thanks,

former_member202208
Active Participant
0 Kudos

Can some one help me on this issue?

Thanks in advance.

former_member185280
Active Contributor
0 Kudos

I think this thread might help:

Basically MII doesn't support the BLOB/CLOB data types so in your query you will need to convert it to a base64 string that MII can consume using the image saver action.

Regards,
Christian