Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Loading pictures/images

Hi

I have to load the following as a picture. I have not come across this before

example in attached file. Any ideas?

7 Replies
adamdavi3s
Master
Master

Is that a SQL BLOB or base 64?

adamdavi3s
Master
Master

For BLOBs I used this weird two step process

// As dumb as it is, this is the two step code to load binary images into QV.

logos:

SQL SELECT

  ConfiguredValue as logo_name

  ,image

  FROM [DW_XXXXXXXXXXXX].[dbo].[XXXXXXXXXXX_SSRS_CONFIG]

  WHERE ConfiguredValueType LIKE 'image%'

  ;

INFO SELECT

  ConfiguredValue as logo_name

  ,image

  FROM [DW_XXXXXXXXXXXXXXXX].[dbo].[XXXXXXXXXXX_SSRS_CONFIG]

  WHERE ConfiguredValueType LIKE 'image%'

  ;

Not applicable
Author

No real idea, it's coming through in an Excel file

adamdavi3s
Master
Master

They look like blobs... but not sure.. its not BASE64 AFAIK

Let me have a play

adamdavi3s
Master
Master

It looks like a BLOB of some sort but I can't get them to import I am afraid.

I tried setting the file up as an ODBC connection and connecting that way but it won't do anything with the strings

MarcoWedel

Hi,

maybe one solution might be:

QlikCommunity_Thread_235800_Pic1.JPG

QlikCommunity_Thread_235800_Pic2.JPG

table1:

LOAD 'Pic'&RecNo() as PicNo,

    A

FROM [https://community.qlik.com/servlet/JiveServlet/download/1139317-249014/Book1.xlsx] (ooxml, no labels, table is Sheet1)

Where Len(A);

Left Join

LOAD A,

    Len(A) as LenPic

Resident table1;

tabTemp:

LOAD A,

    OctetStringToFile(A, 'D:\Temp\'&PicNo&'.yourfileextension') as ResultOctetStringToFile

Resident table1;

Bundle Info LOAD

  PicNo,

  'D:\Temp\'&PicNo&'.yourfileextension'

Resident table1;

QlikCommunity_Thread_235800_Pic3.JPG

Function OctetStringToFile(OctetString, FilePath)

Const adTypeText = 2

Const adSaveCreateOverWrite = 2

LenData = Len(OctetString)\2 + Len(OctetString) Mod 2

set fso = createobject("scripting.filesystemobject")

set stream = createobject("adodb.stream")

stream.type = adTypeText

stream.charset = "windows-1252"

stream.open

For i = 0 to LenData-3

  stream.writetext chr(CByte("&h" & Mid(OctetString, i*2+3, 2)))

Next

stream.savetofile FilePath, adSaveCreateOverWrite

stream.close

OctetStringToFile = "processed"

End Function

hope this helps

regards

Marco

Not applicable
Author

I will have a look at this in the next few days. Thanks for your trouble