PHP:
-- Callback function for HTTP.Download
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
-- Show the StatusDlg
StatusDlg.Show(0, false);
-- Set statusdlg title and message
StatusDlg.SetTitle("Downloading . . . ");
-- Set meter range (max range = 65534)
StatusDlg.SetMeterRange(0, 65534);
-- Download a file from the internet to the user's computer
-- Uses DownloadCallback() as the callback function
HTTP.Download("http://www.uydudoktoru.com/dosyalar/Ali3329B1/YazilimKey/Yazilim.zip", _DesktopFolder.."\\Yazilim.zip", MODE_BINARY, 20, 80, nil, nil, DownloadCallback);
-- Hide the StatusDlg
StatusDlg.Hide();
PHP:
-- Callback function for HTTP.Download
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("Şu anda dosya indiriliyor. . . 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
-- Show the StatusDlg
StatusDlg.Show(0, false);
-- Set statusdlg title and message
StatusDlg.SetTitle("Dosya İndiriliyor . . . ");
-- Set meter range (max range = 65534)
StatusDlg.SetMeterRange(0, 65534);
-- Download a file from the internet to the user's computer
-- Uses DownloadCallback() as the callback function
HTTP.Download("http://www.uydudoktoru.com/dosyalar/Ali3329B1/YazilimKey/Yazilim.zip", _DesktopFolder.."\\Yazilim.zip", MODE_BINARY, 20, 80, nil, nil, DownloadCallback);
-- Hide the StatusDlg
StatusDlg.Hide();