Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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 :
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.
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.
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.