help in monitoring progress on the 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
jasongr
Forum Contributor
Posts: 206
Joined: Tue Jul 27, 2004 6:19 am

help in monitoring progress on the server

Post by jasongr »

Hello people

This is not really a PHP question, but more closely relates to the my ability to monitor an
activity on the server from the browser.
I think that most of the people who use these forums are very clever and I hope to find a solution
to my problem.

I have a PHP code that runs on the server and updates the content of a file.
What I need is someway of writing the size of that file to the user's browser but keep that size updating as the size of the file is updated on the server.
Basically I have 2 processes:
One running on the server and updates the file
The second is updating the size of the file on the user browser as the file size changes on the server.

My question is:
What is the recommended way of updating the size of the file on the user's browser.
I don't want to communicate with the server using an iframe that will get the file size and will update
the value on the screen using JavaScript.
The reason is in such a solution, the content-type of the page that gets invoked by the iframe will be text/html
which makes this page very expensive when accessed a lot using Akami.

I am sure that this sort of problem is very common, especially today when many sites use AJAX.
I hope to get as many suggestions as possible

regards
Jason
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Initiate the processing script via an internal request. You can have a script that can poll the file's size separate from that which you can query in any manner of ways.
jasongr
Forum Contributor
Posts: 206
Joined: Tue Jul 27, 2004 6:19 am

Post by jasongr »

Yes, I know.
My question is not on the internal script.
My question is on the process that will poll the server.
I know that there are several ways of polling the server. The point of this thread
is to familiar me with those ways, so I could pick the one that is right for my application

thanks
Jason
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

The basic ways are meta-refresh and Ajax. Variants may use frames/iframes, as you have said, but the fundamentals don't change.
jasongr
Forum Contributor
Posts: 206
Joined: Tue Jul 27, 2004 6:19 am

Post by jasongr »

I like the solution that uses AJAX to communicate with the PHP page that returns the response in a content-type that is not text/html.

can anyone refer me to a good source for reading on this?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Jquery and the other major Ajax/DHTML frameworks should be good starting points.
jasongr
Forum Contributor
Posts: 206
Joined: Tue Jul 27, 2004 6:19 am

Post by jasongr »

Thanks, I willl check this out
Post Reply