I've chased this on and off over the years in Perl, PHP, ASP . . . think about it for a second.
- Percentage is easy. Total file size / amount received. The problem is in, "what's the total file size?"
- You have to move this file to the server, and that is the only place you can control the received file. But how can you know what the TOTAL file size is before it arrives?
The closest I ever got was using fork() to fork the upload in a child process, inserting a small iframe in the upload page that checked the process ID of the upload and was able to report total bytes uploaded. But as a "progress meter" it was a huge waste of time without knowing the full file size.
Most of the progress meters out there are "fluff and mirrors" and have nothing to do with actual file upload progress. They are configurable, meaning, extend or shorten the length of time allowed for upload. So what you'd do is "fake it" by futzing around with this until it gets close.
Then you send it to the client who has a different connection speed and it all falls down.
But there is a "workaround."
Throw a small animation on the page "uploading, please wait . . . " Put it in a hidden div.
When the upload completes, your script returns a success response, replacing the upload page and returning the form for upload another (or whatever.) This re-hides the uploading div.
I've been watching the PHP progress meter issue too, and wonder just how in the hell they are going to pull that off. Would be great if they can.