11-07-2023, 03:12 PM
One thing you need to watch out for is corrupting your data file.
Open Urlfile$ For Binary As #filehandle <-- This is where you open your file.
Before that line, add this one: Open Urlfile$ For OUTPUT As #filehandle: CLOSE #filehandle
As it exists, you could have the file already on the drive (lets say at 100,000 bytes of data), and then you choose not to erase it. When you download the new version of the file, it's only 96,000 bytes in size -- so it'll overwrite those first 96,000 bytes and then leave the rest unchanged. You need to blank that file before writing to it, or else you're just asking for trouble in the future with left over data.
Open Urlfile$ For Binary As #filehandle <-- This is where you open your file.
Before that line, add this one: Open Urlfile$ For OUTPUT As #filehandle: CLOSE #filehandle
As it exists, you could have the file already on the drive (lets say at 100,000 bytes of data), and then you choose not to erase it. When you download the new version of the file, it's only 96,000 bytes in size -- so it'll overwrite those first 96,000 bytes and then leave the rest unchanged. You need to blank that file before writing to it, or else you're just asking for trouble in the future with left over data.