Hello,
I noticed that the component TWebimage from VCL package does not work anymore.
I don't know if this is related to having upgraded from seatle10 to delphi 11.3 or to a problem with indy components. Below i wrote a snippete taken from Project samples wich worked fine before but not any more.
procedure TForm1.Button1Click(Sender: TObject);
var
url:string;
begin
url :=
https://www.freeusandworldmaps.com/images/World_Regions_Maps/AfricaColorText.jpg';
if not wi.webpicture.Busy then wi.webpicture.loadfromURL(url);
end;
I checked this and I see the server returns a 404 for this HTTP GET request from the component to download the image.
I suspect the server checks if the HTTP request comes from a browser, has some specific header settings maybe and when not, returns a 404.
I checked with another URL for an image on another server and this worked fine. It gets a HTTP 200 code and loads the image.
Thank you for your reply
What next? If I want the component to download an image from some where with a certain url. How can I handle this? Please try to launch the Sample "WebImage" located in demos library? Nothing is loaded!
Please help!
I explained already that the server responds with status code 404
You can even see this in the browser
I'm not sure why this server responds with status code 404. The problem is there and should be handled there.
Otherwise, you'd need to change the TWebImage code to ignore the status code.
The links used when the demo was made (2019) are not valid anymore. That site changed to WordPress, and all the links moved.
For example, instead of
'https://www.freeusandworldmaps.com/images/World_Regions_Maps/EuropeColorText.jpg'
use
'https://www.freeusandworldmaps.com/wp-content/uploads/sites/19/2021/02/EuropePortrait2019_500_72_RSPWeb-1.jpg'
The last time that link was crawled by Web Archive was 2023 March 15.
This what I call a direct and clear answer!!. You are right Julio, I succeeded to download the images using the new URL.
Thank kou very much