How to check if file download is correct

you can create a function waitFileExists(fileAbsPath) and performs your expectations after the file is completely downloaded.

For example, with the DIR function you can check if a specific Excel file exists and Over 50 Excel macro examples for download & useful VBA codes you can  My question: how can I check if the file was downloaded and saved? I want to make an function readfile_chunked($filename,$retbytes=true)