phpapacheloggingx-sendfile

Is there any way to tell when an X-Sendfile download has completed?


In the interest of cleaning up temporary files on the webserver, I'm wondering if there's any way to tell when X-Sendfile downloads complete... maybe in a log somewhere? My understanding currently is that once you pass off the headers it is basically on its own.


Solution

  • Apache only logs a hit once the connection's closed, which presumably would be whenever the download is finished. So monitoring the access log for the specific download url would tell you when it's completed - comparing the logged bytes-sent v.s. how much you expected to send will also tell you if the download was successful or if it was aborted.