Page 1 of 1

Keeping the session open

Posted: Tue Mar 08, 2005 10:02 am
by utahcon
Not really a session question.

What I have is a process that uploads files to an FTP.

However the files can be of some size and cause the browser to timeout before the file is done uploading, and sometimes there are multiple files.

What can I do to stop the browser from timin out?

Thanks!

Posted: Tue Mar 08, 2005 10:06 am
by feyd
you can't really.. the browser sets its own timeout restrictions. I'd suggest emailing the user when the ftp operation is complete... potentially with a log of what happened. I'd also suggest only doing the email with log on larger amounts of data, the threshold between this would be determined by the impatience of your users and the speed of the connections involved..

Posted: Tue Mar 08, 2005 10:11 am
by utahcon
is there maybe a way to count the number of seconds that pass while the ftp_put function is running and output something to the buffer to hold the browser from timing out?

Posted: Tue Mar 08, 2005 10:17 am
by feyd
I believe PHP hangs while it sends the data. So no. Is your page timing out instead of the browser? Because that's a different thing.. set_time_limit() can tell php to allow more time for the script to execute.

Posted: Tue Mar 08, 2005 10:18 am
by utahcon
I think the browser.

The page outputs data - and the script will continue to run outside of the browser (ie. i run it through cron).

Thanks anyways!