Keeping the session open

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
utahcon
Forum Newbie
Posts: 3
Joined: Tue Mar 08, 2005 9:54 am

Keeping the session open

Post 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!
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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..
utahcon
Forum Newbie
Posts: 3
Joined: Tue Mar 08, 2005 9:54 am

Post 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?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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.
utahcon
Forum Newbie
Posts: 3
Joined: Tue Mar 08, 2005 9:54 am

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