skwap Posted December 30, 2011 Share Posted December 30, 2011 Friends, suppose iam copying 1 to 100 files using a loop in php & when the copy process reach at 50th file my browser went offline. My doubt is will it copy all 100 files ?? OR it will terminate at 50th file ? if i want to get all files copied if the browser went offline then what i want to do ?? Please clear Quote Link to comment https://forums.phpfreaks.com/topic/254071-please-clear-my-doubt/ Share on other sites More sharing options...
Muddy_Funster Posted December 30, 2011 Share Posted December 30, 2011 Assuming everything else is on the server, I think the script would still fail as the process is controlled by the HTTP session connection to the host. If you were running it on the servers console it would go on regardless, but if the controlling process (your web session) terminates, I am 99% sure it will terminate the PHP scripting within it (been around computers so long I'm never 100% about anything any more!). Quote Link to comment https://forums.phpfreaks.com/topic/254071-please-clear-my-doubt/#findComment-1302481 Share on other sites More sharing options...
ignace Posted December 30, 2011 Share Posted December 30, 2011 Add the below line to your script: ignore_user_abort(true); http://php.net/manual/en/function.ignore-user-abort.php This will continue the script regardless if the user closed the browser. Quote Link to comment https://forums.phpfreaks.com/topic/254071-please-clear-my-doubt/#findComment-1302504 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.