[Solution Request] Is cleint download from server?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
sweb
Forum Newbie
Posts: 18
Joined: Tue Oct 30, 2007 6:32 am
Location: Iran (Semnan)

[Solution Request] Is cleint download from server?

Post 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.
User avatar
markusn00b
Forum Contributor
Posts: 298
Joined: Sat Oct 20, 2007 2:16 pm
Location: York, England

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

Post 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.
Post Reply