Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
marcel_olmo
Partner Ambassador
Partner Ambassador

How to download images from website with QlikSense?

Hello guys,

I have a list with several companies, and I'd like to show their logo in my Qlik Sense App.

By default I link my companies with an internet url which contains the image of their logo,

but sometimes I don't have internet access and I'd like to download those images in a private folder, to link them in the same way as before, but with a local route.

 

I've attached an example of 3 companies and the internet routes of their logos like this :

co1.PNG

 

 

 

And I'd like to have a script to download them into a local file. Anybody knows how to do that?

The link of the attached example is below.

Best regards, Marcel.

 

Labels (1)
2 Replies
chrismarlow
Specialist II
Specialist II

Hi,

Taking a bit of this, I would probably not try to use Qlik to download the files for you as I'm not sure (although someone might know better, always happy to be corrected).

I would probably use Python, so from a quick read of 'Automate the boring stuff with Python', gave the following (I did need to add requests package through pip intaller);

import requests
from time import sleep

def pullpic(uri, filename):
    print('Getting',uri)
    res=requests.get(uri)
    sleep(2)
    res.status_code=requests.codes.ok
    playfile=open(filename,'wb')
    for chunk in res.iter_content(100000):
        playfile.write(chunk)
    playfile.close()
    print('Saved',filename)


pullpic('https://1000marcas.net/wp-content/uploads/2020/01/Lidl-Logo.png','C:/yourfolder/Lidl-Logo.png')
pullpic('https://www.mercadona.com/estaticos/images/mercadona_logo/es/mercadona-imagotipo-color-300.png','C:/yourfolder/mercadona-imagotipo-color-300.png')
pullpic('https://www.caprabo.com/export/shared/.galleries/articulos/caprabo.png_940553528.png','C:/yourfolder/caprabo.png_940553528.png')

I would then look to use those files, and update them as required, rather than try to have a link sometimes/cope with no link if you don't have internet (but not sure I followed how you would be handling that).

Cheers,

Chris.

marcel_olmo
Partner Ambassador
Partner Ambassador
Author

Thanks for your quick answer @chrismarlow , I'm trying to do it inside the qlik app because is the program I know. I'm going to ask to my colleagues from IT if they can help me with your code.

Best regards, Marcel.