Hmm..
About how the PHP and JS are playing toghether we talk a lot in this form. Please see JS Vs PHP.
Anyway, my opinion is: let JS and PHP to work as they already are. PHP on the server side and JS on the client side. Never try a mixture.
So... If you want to check periodicaly the upload status, I never recommend you to try to upload a file using PHP functions and control the upload using JS functions.
My question is? Why do you need to do that? If you allow some "external" clients to upload files you can limit the file's size. In this case you do not need anymore to handle the upload progress. If is an internal one you can use FTP or write some dedicated client side procedures (Java, C, or why not VFP + WinInet).
Just like an idea, here is a little toy:
http://xtrax.ro/php/fileupload/fileupload.php
The code is at http://xtrax.ro/php/fileupload/fileupload.zip
http://xtrax.ro/php/fileupload/fileupload.php
Notes:
1. Only images files are allowed;
2. The refresh of the new uploaded file will be controlled of your browser (check your settings);
4. The ideea is to start two threads when the upload start. First one (onClick event) open a new window (progress.php) to handle the upload progress. The second one, start the upload ( upload.php)
5. The progress.php is just an "ideea". Try to finish it
- the progress