You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My download path needs to limit the number of downloads, but if I don't use split downloads, it will still generate two download requests. I read the official documentation and it may be because the file size is requested from the download server once before downloading. Is there any way to generate only one download request or not request the file size?
The text was updated successfully, but these errors were encountered:
Before initiating the download, it's necessary to determine the file size in order to allocate space for it on the local storage and configure the chunk sizes appropriately. This typically results in an initial request to the server to fetch the file size before the actual download process begins.
If your requirement is to limit the number of requests to a single one, you could consider using the HttpClient class directly. However, please note that the Downloader is designed specifically to manage various events and issues that may occur during the download process. For instance, if your connection is interrupted, the Downloader is built to automatically reconnect and resume the download. This functionality requires multiple requests and retry logic, which might conflict with any limitations you’re trying to enforce on the number of requests.
Could you provide more details on why you need to limit the number of requests? With more context, we may be able to suggest a better solution that meets your needs.
@fusheng357 I think your solution is not safe because a download can be reconnect because of many reasons. You can manage this with the Downloader events like:
// Provide `FileName` and `TotalBytesToReceive` at the start of each downloaddownloader.DownloadStarted+=OnDownloadStarted;// Provide any information about chunker downloads, // like progress percentage per chunk, speed, // total received bytes and received bytes array to live streaming.downloader.ChunkDownloadProgressChanged+=OnChunkDownloadProgressChanged;// Provide any information about download progress, // like progress percentage of sum of chunks, total speed, // average speed, total received bytes and received bytes array // to live streaming.downloader.DownloadProgressChanged+=OnDownloadProgressChanged;// Download completed event that can include errors or // canceled or download completed successfully.downloader.DownloadFileCompleted+=OnDownloadFileCompleted;
My download path needs to limit the number of downloads, but if I don't use split downloads, it will still generate two download requests. I read the official documentation and it may be because the file size is requested from the download server once before downloading. Is there any way to generate only one download request or not request the file size?
The text was updated successfully, but these errors were encountered: