Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Grab URL from net to file
#11
(02-13-2026, 04:53 AM)SMcNeill Wrote:
(02-13-2026, 03:03 AM)eoredson Wrote: Recently I got a program to get the status of a Url download from the .net

Code: (Select All)
' try to read info on url download. pd 2026.
Cls
URL$ = "http://www.applewoodbbs.linkpc.net/files/ifdc/oredson/SPHERE9.ZIP"
x = Download(URL$, outx)
End

Function Download (url As String, StatusCode As Long)
  Dim bytes As Long, Length As Long
  h& = _OpenClient(url)

  StatusCode = _StatusCode(h&)
  Locate 1, 1: Print "Status:"; StatusCode
  Length = LOF(h&)
  Locate 2, 1: Print "LOF:"; Length
  While Not EOF(h&)
      _Limit 60
      Get #h&, , s$
      bytes = bytes + Len(s$)
      percent! = Int((bytes / Length) * 100!)
      percent$ = Right$("000" + LTrim$(Str$(percent!)), 3) + "%"
      Locate 3, 1: Print percent$;
  Wend
  Close #h&
End Function

You do realize there's an entire wiki page dedicated to downloading files, with multiple examples for various use cases?

https://qb64phoenix.com/qb64wiki/index.p...ding_Files
Thanks Steve! I've never seen that page before --- this will be of immense help.
Reply
#12
It’s the exact same page referenced in reply #2, that you spoke about in reply #3.  You’re just getting old and forgot about it!  Big Grin
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)