Can the browser know when a download is finished?


I'm wondering if there's any way that the web browser can send a signal to the web server to indicate that a file has finished downloading.

I'm using "Application.Download('');"

The web server is Indy. Everything is working properly with the download, but I would like to tell the server, "okay, the user has the file" and then the server can delete the file because it no longer needs it.

Is it possible to do this?

There is not a straightforward way to know this from code when you use Application.Download() as this just starts a browser download as-is.
You could use a TWebHttpRequest component to perform the http request (and you would then need to save the downloaded data to file). When TWebHttpRequest.OnResponse is triggered, the HTTP GET request was terminated.