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.
If you find these projects useful please consider becoming a sponsor with Patreon, GitHub or Liberapay.

Intercept download ?

Post Reply
thefunkyjoint
Posts: 513
Joined: Thu Aug 10, 2017 12:40 pm

Intercept download ?

Post by thefunkyjoint »

Hi,

Let's suppose this scenario :

1 - User navigates to a web-site where there is a link on a ZIP file.

2 - User clicks on this link.

I want to open this link (and download it) using the default machine's browser, not CEF4. Is this possible ?

Thanks !
User avatar
salvadordf
Posts: 4564
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Intercept download ?

Post by salvadordf »

Yes, it's possible with some exceptions.

Use the TChromium.OnBeforeDownload event, copy the URL from downloadItem.URL and call callback.cancel. Then use another program/service/component to download the URL you copied.

However, if you need to login in a website to download that file then you may have some problems. In that case, you would need to login again with the alternative downloader and some websites don't like to have users logged multiple times.

Some URLs can only be downloaded in the same browser. For example, the BLOB URLs used by mega.nz
thefunkyjoint
Posts: 513
Joined: Thu Aug 10, 2017 12:40 pm

Re: Intercept download ?

Post by thefunkyjoint »

Thank you ! :D
Post Reply