Grab URL from net to file - Printable Version +- QB64 Phoenix Edition (https://qb64phoenix.com/forum) +-- Forum: QB64 Rising (https://qb64phoenix.com/forum/forumdisplay.php?fid=1) +--- Forum: Code and Stuff (https://qb64phoenix.com/forum/forumdisplay.php?fid=3) +---- Forum: Help Me! (https://qb64phoenix.com/forum/forumdisplay.php?fid=10) +---- Thread: Grab URL from net to file (/showthread.php?tid=2124) |
Grab URL from net to file - eoredson - 10-28-2023 I have recently been using the following function to grab a file from the net: Code: (Select All) Rem Program to grab file from url PD 2023. Thanks, Erik. RE: Grab URL from net to file - DSMan195276 - 10-28-2023 You can get progress information by providing an implementation of the `IBindStatusCallback` interface to the `lpfnCB` parameter. This can't be done via QB64 alone though, you'd need to write some C++ code to implement the interface and then you could pass the progress information back to QB64. That said, recent QB64-PE versions have native HTTP support which you could use in place of `URLDownloadToFile` and would allow you to display progress information. See Examples 2 and 4 on the Wiki page about it, they show examples of displaying the progress of the download as it is happening, and also downloading directly to a file (where you write to the file as you receive the data). RE: Grab URL from net to file - eoredson - 10-28-2023 Ok, thanks. $Unstable:Http have to be used? RE: Grab URL from net to file - SpriggsySpriggs - 10-28-2023 Check my programming corner for 3 download routines RE: Grab URL from net to file - eoredson - 10-31-2023 (10-28-2023, 12:06 PM)SpriggsySpriggs Wrote: Check my programming corner for 3 download routines Where is your programming corner? RE: Grab URL from net to file - TerryRitchie - 10-31-2023 (10-31-2023, 07:22 AM)eoredson Wrote:(10-28-2023, 12:06 PM)SpriggsySpriggs Wrote: Check my programming corner for 3 download routines https://qb64phoenix.com/forum/forumdisplay.php?fid=30 RE: Grab URL from net to file - eoredson - 11-01-2023 Hmm.. A GrabUrl that actually works!? Could you add Ctrl-V to paste url? Thanks, Erik. btw: when input as invalid url such as: splat.txt it throws multiple dialog error boxes.. RE: Grab URL from net to file - SpriggsySpriggs - 11-01-2023 (11-01-2023, 05:44 AM)eoredson Wrote: Hmm.. A GrabUrl that actually works!?The initial screen should be a console window, which allows for pasting. As far as the errors go, I did not do any error checking for invalid URLs because these are primarily examples for showing how to do it rather than finished products. You would have to write your own error handlers. But all three do work and work well, at least. |