Page 1 of 1
Download file strange error
Posted: Fri May 27, 2022 9:04 am
by tad.chen
A strange error is found When I use TChromium's download function to download file.
In chrmosrDownloadUpdated procedure, every thing is OK in the beginning. The ReceivedBytes of downloadItem become larger and larger, unitl it's the same as TotalBytes. It seams that file download is successful.
But In the end, ReceivedBytes become 0, and both IsInProgress and IsComplete are false. At the same time, the download file disppeared.
I don't know the reason. Could you give me some advice? I use CEF 95.
Re: Download file strange error
Posted: Sat May 28, 2022 4:17 pm
by salvadordf
Try to download the same file with the same version of Chromium you use in CEF to check is there's a problem in Chromium or the server.
I just downloaded 2 files from 2 different servers and everything was OK. I used the latest CEF4Delphi version.
Re: Download file strange error
Posted: Mon May 30, 2022 3:22 am
by tad.chen
I use cefclient in the same cef version to download file in the same enviroment. It works successfully.
The downloading file error is found in an intranet, and I find another error in it. It'll cause ERR_ABORTED if the browser opens an new url before current url's chrmosrLoadEnd is triggered.
Re: Download file strange error
Posted: Mon May 30, 2022 10:33 am
by salvadordf
Use a different browser in the background to handle normal downloads. BLOB downloads however must be handled by the same browser that the user was using at that moment.
Read the code comments for :
- ICefDownLoadItem : https://github.com/chromiumembedded/cef/blob/4638/include/capi/cef_download_item_capi.h
- The download handler that triggers the download events in TChromium : https://github.com/chromiumembedded/cef/blob/4638/include/capi/cef_download_handler_capi.h
- Chromium error codes : https://chromium.googlesource.com/chromium/src/+/master/net/base/net_error_list.h
cefclient only checks if the download item is complete :
https://github.com/chromiumembedded/cef/blob/d9b764860aa0c1dfad58b123474bc133c4e43d39/tests/cefclient/browser/client_handler.cc#L566
Perhaps the server only allows one connection to download a file and it aborts the other connections if the application tries to create multiple connections.
Re: Download file strange error
Posted: Tue May 31, 2022 2:34 pm
by tad.chen
But if I change to old CEF library, which is 7X, the downloading file is OK.
The download code of the two browsers is the same, the only difference is the CEF library. CEF 7X can work, but CEF 95 can't.
I think that there is maybe some error during file downloading. How to get error information?
Re: Download file strange error
Posted: Wed Jun 01, 2022 7:25 am
by salvadordf
If that's the case then all these issues are probably caused by a change in Chromium's code.
All the error information we have is the list of error codes and the code comments next to each error code.
Check the connection logs in the intranet server too.
Also check the complete list of issues in Chromium. Perhaps this is a known issue :
https://bugs.chromium.org/p/chromium/issues/list
Perhaps you can get more information if you install Wireshark to inspect the HTTP traffic :
https://www.wireshark.org/
Re: Download file strange error
Posted: Wed Jun 01, 2022 7:28 am
by salvadordf
I almost forgot. Try using the Network tab in the DevTools.
Re: Download file strange error
Posted: Mon Jun 06, 2022 11:20 pm
by tad.chen
Thank you for your information! It seams that it's because of the firewall, which stops file transfering.