in reply to download attempted vs completed

In the past I have updated a SQL database after close(FILE2); to say "user X has downloaded file Y".

You will probably also have to look into how HTTP can download files from part way through. It's been a long time since I dealt with it. Maybe google for things like "HTTP partial download" or read the HTTP RFC.