Hi,
I'm trying to download a large file (around 12 GB). There is no problem with downloading but the info we get through the callback is wrong. Taken the below code from the documentation and the total file size it shows is only 2 GB, not 12 GB. Because of this, all other information is collapsing. Someone can help me on how to fix this?
I'm trying to download a large file (around 12 GB). There is no problem with downloading but the info we get through the callback is wrong. Taken the below code from the documentation and the total file size it shows is only 2 GB, not 12 GB. Because of this, all other information is collapsing. Someone can help me on how to fix this?
Code:
-- Callback function for HTTP.DownloadSecure function DownloadCallback (nDownloaded, nTotal, TransferRate, SecondLeft, SecondsLeftFormat, Message) -- Convert total and downloaded bytes into formatted strings sDownloaded = String.GetFormattedSize(nDownloaded, FMTSIZE_AUTOMATIC, true); sTotal = String.GetFormattedSize(nTotal, FMTSIZE_AUTOMATIC, true); -- Output time left, formatted. StatusDlg.SetMessage("Currently downloading file . . . Time Left: " .. SecondsLeftFormat); -- Output formatted sizes to user through statusdlg status text StatusDlg.SetStatusText("Downloaded: " .. sDownloaded .. " / " .. sTotal); -- Set meter position (fraction downloaded * max meter range) StatusDlg.SetMeterPos((nDownloaded / nTotal) * 65534); end -- Set statusdlg title and message StatusDlg.SetTitle("Downloading . . . "); StatusDlg.SetMessage("Currently downloading file . . . "); -- Set meter range (max range = 65534) StatusDlg.SetMeterRange(0, 65534); -- Show the StatusDlg StatusDlg.Show(0, false); -- Download a file from the internet to the user's computer -- Uses DownloadCallback() as the callback function HTTP.DownloadSecure("https://dkz9tcs83ng3p.cloudfront.net/sermon-updates/2022/jan/jan_ctsermons_package_2022.rar", _TempFolder .. "\\update.exe", MODE_BINARY, 20, 443, nil, nil, DownloadCallback); -- Hide the StatusDlg StatusDlg.Hide();
Comment