How to know chromium is not downloading files?

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

How to know chromium is not downloading files?

Post by coater » Tue Jul 09, 2019 2:27 pm

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: 1950
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: How to know chromium is not downloading files?

Post by salvadordf » Wed Jul 10, 2019 12:52 pm

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.

coater
Posts: 52
Joined: Sat Sep 29, 2018 1:51 pm

Re: How to know chromium is not downloading files?

Post by coater » Wed Jul 10, 2019 1:36 pm

Thank you very much!

Post Reply