Is it possible to use LiveCode to download images from the internet to the computer?... I'm using the libURLDownloadToFile command but I can't get it, can someone please help me? Thank you very much.
For example:
https://img.kiosko.net/2020/11/08/es/canarias7.750.jpg
https://img.kiosko.net/2020/11/08/es/sport.750.jpg
Downloading images from a website
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Re: Downloading images from a website
Hola Fermin,
hm, this worked for me:
What did you script so far?
Best
Klaus
hm, this worked for me:
Code: Select all
on mouseUp
put specialfolderpath("desktop") & "/el_testo666.jpg" into tFile
libURLDownloadToFile "https://img.kiosko.net/2020/11/08/es/canarias7.750.jpg",tFile
end mouseUp
Best
Klaus
Re: Downloading images from a website
Hi, Klaus. I'm back in Livecode (since a long time) and yesterday I started to prepare a utility to download newspaper covers. I've hardly used LiveCode with the Internet and until today I didn't know the libURLDownloadToFile command. I had been trying it for a while and wasn't sure if it would work, so I asked for help .... And like other times before, you gave me a hand. Thanks a lot, Klaus.
I put a little bit of my code (testing it crazy) but I already imagine that I was doing it wrong. The code you sent me works well so I'm going to investigate it and adapt it to my work. Thanks again.
Translated with www.DeepL.com/Translator (free version)
on mouseUp
/*201007-1753*/
put "http://kiosko.net" into cabe
put "np" into nipu
put ".html" into final
put "http://kiosko.net/es/2020-09-30/np/elcorreo.html" into cosa
put "http://kiosko.net/es/np/elcorreo.html" into foto
put "/Users/miMac27d/Downloads" into casa
put "https://img.kiosko.net/2020/11/08/es/la ... ia.750.jpg" into imagen
launch url imagen
-- load url cosa as timage
--+++ launch url "http://kiosko.net/es/2020-09-30/np/elcorreo.html"
---
libURLDownloadToFile imagen, casa,"downloadComplete"
-- answer the result
---
exit to top
launch url "http://kiosko.net/es/2020-09-30/np/elcorreo.html"
launch url "http://kiosko.net/es/2020-11-07/np/elcorreo.html"
launch url "http://kiosko.net/es/2020-11-08/np/elcorreo.html"
launch url "http://kiosko.net/es/np/elcorreo.html"
end mouseUp
I put a little bit of my code (testing it crazy) but I already imagine that I was doing it wrong. The code you sent me works well so I'm going to investigate it and adapt it to my work. Thanks again.

Translated with www.DeepL.com/Translator (free version)
on mouseUp
/*201007-1753*/
put "http://kiosko.net" into cabe
put "np" into nipu
put ".html" into final
put "http://kiosko.net/es/2020-09-30/np/elcorreo.html" into cosa
put "http://kiosko.net/es/np/elcorreo.html" into foto
put "/Users/miMac27d/Downloads" into casa
put "https://img.kiosko.net/2020/11/08/es/la ... ia.750.jpg" into imagen
launch url imagen
-- load url cosa as timage
--+++ launch url "http://kiosko.net/es/2020-09-30/np/elcorreo.html"
---
libURLDownloadToFile imagen, casa,"downloadComplete"
-- answer the result
---
exit to top
launch url "http://kiosko.net/es/2020-09-30/np/elcorreo.html"
launch url "http://kiosko.net/es/2020-11-07/np/elcorreo.html"
launch url "http://kiosko.net/es/2020-11-08/np/elcorreo.html"
launch url "http://kiosko.net/es/np/elcorreo.html"
end mouseUp
Last edited by Fermin on Sun Nov 08, 2020 9:31 pm, edited 2 times in total.
Re: Downloading images from a website
Of course, there was the destination folder... but the file name (laDeskarga.jpg) was missing!
put "/Users/miMac27d/Downloads/laDeskarga.jpg" into casa
put "/Users/miMac27d/Downloads/laDeskarga.jpg" into casa
Re: Downloading images from a website
Exactamento! 
