is fopen() streaming after reload possible?

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
Tuoni
Forum Newbie
Posts: 1
Joined: Thu Jan 08, 2009 3:20 pm

is fopen() streaming after reload possible?

Post by Tuoni »

I'm currently using the standard while(!feof($file) way of streaming files from my website to the browser. All was well and good on my development server, however when uploading it to the production server I have encountered a problem.

Basically, this host has something which kills PHP scripts if they execute for longer than 10 minutes - I have tried set_time_limit(0) in the while loop to no avail, my guess is it's a server setting, not a PHP ini setting.

Is there any way that I can stream for 9 minutes, reload the page and carry on from where i left off, or something like that?

I have been trying to get it to work for so many hours now my mind is boggled, I'm not even sure what I'm trying to do is possible.

I have tried GETting file handles and pointer positions - but the gc grabs the file resource; opening the file and moving to the pointers' last position before continuing to print to the buffer just kills the stream after the reload and echoes the contents out into a webpage.

I'm really at a loss with how to go about this, my mind is frazzled.

Is this even possible? If so, how on Earth do I go about doing it?
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Re: is fopen() streaming after reload possible?

Post by VladSun »

There are 10 types of people in this world, those who understand binary and those who don't
Post Reply