Page 1 of 1

[Solution Request] Is cleint download from server?

Posted: Sun Oct 11, 2009 9:39 am
by sweb
hail i want a way to know the user(an IP) have a download in progress or no.
the user stard the download and close the web page of my site.

Re: [Solution Request] Is cleint download from server?

Posted: Sun Oct 11, 2009 3:08 pm
by markusn00b
I'd like to say I have a definite answer to this, but, alas, I do not. My thoughts on the subject are: it may be possible. I do not remember if a PHP script continues executing if the tab is closed, if it is a long running process. I assume you're sending the file contents to the browser via a readfile() call. You might test my theory by sticking some script after the readfile() call that, say, switches a flag in your database. If the flag remains unswitched until after the file has completed downloading, you will know that the script does continue running and, therefore, you can determine when a file has finished being sent to the browser.

Note: I'm relatively certain the above is not the case - but in times of uncertainty... test!

Mark.