Re: File uploads - progress reporting gets stuck short of 100%



John Geddes wrote:
Jerry Stuckle wrote:

Are you using sessions? PHP will single thread access to the same session data.


Yes - I was. Removing the $_SESSION references from the upload page has solved the problem. Thanks so much, Jerry

But ... on my following page, which processes the uploaded image (including resampling to several different sizes) I had intended to use a $_SESSION variable to signal approximate "percentage done" back to the progress-checker, and thus to the user page. But this won't work because of the single-thread limit with S_SESSION.

Breaking up the page is possible, but it would be a shame - as I would have to recreate the PHP image object each time (as it stands, I can create the image once, then create several resampled copies).

Any ideas on how I can report part-progress from a PHP page without using a $_SESSION variable?

John Geddes


Database or flat file works fine.

You can access the session and get some quick information - you just need to close the session before anyone else can access the info. You just can't reopen it.

BTW - personally, I really don't care for displaying the percentage done. And you're going to have problems with PHP anyway, because data sent to the client can be buffered by PHP, the web server and the browser. And the only one you can control is PHP. So even though you send an update to the client, it doesn't mean the client will get it. And if it's a large upload, your update page may time out on you.

AJAX, Flash or Java would probably be a better choice for something like this.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@xxxxxxxxxxxxx
==================

.



Relevant Pages