Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.

How to know chromium is not downloading files?

Post Reply
coater
Posts: 135
Joined: Sat Sep 29, 2018 1:51 pm

How to know chromium is not downloading files?

Post 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!
User avatar
salvadordf
Posts: 4016
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: How to know chromium is not downloading files?

Post 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/pr ... dItem.html

You can also check the "failedUrl" parameter in TChromium.OnLoadError to see if some download item has that URL.
coater
Posts: 135
Joined: Sat Sep 29, 2018 1:51 pm

Re: How to know chromium is not downloading files?

Post by coater »

Thank you very much!
Post Reply