Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Use the IntGetFile function to download files.
#1
When using the IntGetFile function with a link that has redirection, the file cannot be downloaded on some Windows 10 systems — the download progress window closes immediately.
Since the test computer does not have QM (Quick Macro) installed, I’m unable to retrieve any debugging information.

Is there any solution to this issue?
I noticed that the function has an `inetFlags` parameter, which enables redirection by default. In most cases, the download works correctly, but it fails on certain systems.

Thanks in advance for any suggestions or help.

Macro Macro3
Code:
Copy      Help
str url="https://dlink.host/1drv/aHR0cHM6Ly8xZHJ2Lm1zL3UvcyFBZ204d3BjSVhDanNnNHRuV2VyWDNxWk9BM0JBcUE.zip"
str tempFile=F"$Temp$\t.jpg"
IntGetFile url tempFile 16 0 1
#2
Is there a more stable, runtime-free, native method for downloading files that supports link redirection and works on Windows 7 and above?
#3
IntGetFile uses wininet API, it's is very old. It's better to use WinHttp API. Search this forum.
#4
Thanks for your help.
The code below works, but it doesn't show the download progress.
How can reuse the progress bar code below?
`SetProgressDialog(dlg); SetProgressCallback(fa fparam)`

Function httpDownload_T
Code:
Copy      Help
typelib WinHttp {662901FC-6951-4854-9EB2-D9A2570F2B2E} 5.1
WinHttp.WinHttpRequest r._create

str url="https://dlink.host/1drv/aHR0cHM6Ly8xZHJ2Lm1zL3UvcyFBZ204d3BjSVhDanNnNHRuV2VyWDNxWk9BM0JBcUE.zip"
str tempFile=F"$desktop$\t.jpg"
r.Open("GET" url)
r.Send()
if(r.Status!=200) ret

ARRAY(byte) a=r.ResponseBody
str s.fromn(&a[0] a.len)

s.setfile(tempFile)
#5
Don't know. Google for "WinHttp progress".


Forum Jump:


Users browsing this thread: 1 Guest(s)