Page 1 of 1

How to know chromium is not downloading files?

Posted: Tue Jul 09, 2019 2:27 pm
by coater
using ' Chromium1DownloadUpdated' and 'Chromium1BeforeDownload' we may know that chromium start or remain downloading. So I can put a boolean variable(such as Ifdownloading :=true) in the procedures and set it to true.

But, sometimes downloading may be canceled by web errors or others. So downloadItem.IsComplete may not be triggered and I cannot set Ifdownloading to false.

How to resolve this problem? Thank you!

Re: How to know chromium is not downloading files?

Posted: Wed Jul 10, 2019 12:52 pm
by salvadordf
Hi,

You need to use TChromium.OnDownloadUpdated and TChromium.OnLoadError

Check the "downloadItem" parameter in the OnDownloadUpdated event. You need to check the returned value of downloadItem.IsCanceled, downloadItem.IsComplete and downloadItem.IsInProgress. Read this for more information :
https://magpcss.org/ceforum/apidocs3/projects/(default)/CefDownloadItem.html

You can also check the "failedUrl" parameter in TChromium.OnLoadError to see if some download item has that URL.

Re: How to know chromium is not downloading files?

Posted: Wed Jul 10, 2019 1:36 pm
by coater
Thank you very much!