Cancel download in TChromium.OnBeforeDownload
Posted: Fri Mar 27, 2020 5:32 pm
Hi,
I'm trying to do the "multiple file download" like in Chrome. When user click several download links - I wish to show the progress of every file being downloaded in the same time.
I want to use TCEFUrlRequestClientComponent - create it for every file that is being clicked and then lisntening to allevents that are needed to complete the download.
Question one: is there a better solution of doing this ? Maybe TChromium has built in engine to do this automatically. Now in my case when I start the next file download - the current one is "canceled" (which is showed in DevTools). Is there any option to enable multiple downloads ?
My plan was to initiate the TCEFUrlRequestClientComponent in "TChromium.OnBeforeDownload", where I have all needed information: url , suggestedFilename. I want to cancel the default "download" and start the UrlRequest download.
My solution has one problem. In TChromium.OnBeforeDownload I can't "cancel" the download.
The parameter: callback: ICefBeforeDownloadCallback
has not any method called "cancel".
I'm trying to do the "multiple file download" like in Chrome. When user click several download links - I wish to show the progress of every file being downloaded in the same time.
I want to use TCEFUrlRequestClientComponent - create it for every file that is being clicked and then lisntening to allevents that are needed to complete the download.
Question one: is there a better solution of doing this ? Maybe TChromium has built in engine to do this automatically. Now in my case when I start the next file download - the current one is "canceled" (which is showed in DevTools). Is there any option to enable multiple downloads ?
My plan was to initiate the TCEFUrlRequestClientComponent in "TChromium.OnBeforeDownload", where I have all needed information: url , suggestedFilename. I want to cancel the default "download" and start the UrlRequest download.
My solution has one problem. In TChromium.OnBeforeDownload I can't "cancel" the download.
The parameter: callback: ICefBeforeDownloadCallback
has not any method called "cancel".