The download and progress works perfectly. Your URL is invalid and does not link directly to a file - a download/login page is displayed instead. Before stating that something does "never work", you may want to check the log file for errors and hints what might be wrong.
Ulrich
Announcement
Collapse
No announcement yet.
HTTP.Download or HTTP.DownloadSecure not working properly
Collapse
X
-
HTTP.Download or HTTP.DownloadSecure not working properly
Why does HTTP.DownloadSecure or HTTP.Download never work? or sometimes rarely? A popup happens for the download dialogue, but disappears incredibly quickly and goes to the next step. Is it because of the link? Tried different sites with direct download (discord, google drive, anonfiles, uploadhaven), but to no luck.
Here is the script:
Code:function ShowStatusWindow() StatusDlg.Show(MB_ICONINFORMATION, false); StatusDlg.ShowCancelButton(true, "Stop Download"); end function DownloadStatus (BytesRead, FileSize, TransferRate, SecondsLeft, SecondsLeftFormat, Message) StatusDlg.SetMeterRange(0, 65534); StatusDlg.SetMeterPos((BytesRead / FileSize) * 65534); if StatusDlg.IsCancelled() then StatusDlg.Hide(); return false; else if FileSize == 0 then StatusDlg.SetStatusText("Size Unknown (" .. Math.Floor(BytesRead/1024/1024) .. "MB downloaded so far)"); elseif FileSize > 0 then StatusDlg.SetStatusText("Downloaded " .. Math.Floor(BytesRead/1024/1024) .. " MB of " .. Math.Floor(FileSize/1024/1024) .. " MB"); end if (Message == "") and (BytesRead > 0) and (BytesRead == FileSize or FileSize == 0) then StatusDlg.Hide(); Dialog.Message("Download Complete", Math.Floor(BytesRead/1024/1024) .. " MB have been downloaded"); return false; else return true; end end end ShowStatusWindow(); HTTP.DownloadSecure("https://cdn-121.anonfiles.com/3e82Pctep0/e0bb789d-1606496950/LongDriftSpeed.mp4", SessionVar.Expand("%Desktop%\\Moonie.zip"), MODE_BINARY, 20, 443, nil, nil, DownloadStatus);
Tags: None
-
Leave a comment: