[Gambas-user] WebDownload

T Lee Davidson t.lee.davidson at gmail.com
Fri May 11 18:09:17 CEST 2018


On 05/11/2018 10:17 AM, M Be wrote:
> No problem. Thanks for your help, though.
> I found a workaround with HttpClient for this application case.
> 
> @Lee:  if you are reading this, maybe you have an explanation/solution
> 
> Best regards
> Ingo

The reason using WebView/WebDownload isn't working is because setting Webview.Url doesn't trigger a download of the image file.
It loads the image, for viewing, as if it is embedded within a webpage inside an IMG tag. You can see what I mean if you print
the HTML as in:

  'First wait for Url to load
  While hWebview.Progress < 1
    Wait 0.1
  Wend
  Print hWebview.HTML
  'Set breakpoint here

And, since a download is not triggered, the WebView.Download event is also not triggered.


For fetching images, it makes more sense to simply use HttpClient as Charlie has done.


-- 
Lee


More information about the User mailing list