Ajax获取文件大小

I'm trying to create a custom ajax upload for a project .
therefore dont want to use some open source scripts/codes.
So Here's the situation
im trying to get upload size of the file using jquery ajax while the file is uploading by fetching file size of the file from a php file.
So i'll use .delay() to repeat process after a certain interval and '$_FILES['file'] ['tmp_name'] ' to fetch its name and size etc ..
can any body help me on how to do this ???
im a bit confused ..

With a standard install of PHP, you will not be able to track the upload of a file : once the upload is complete, you'll be able to work with $_FILES ; but not as long as the upload is in progress.


If you want to keep track of the progress of an upload, you'll have to either :


Here are a couple of articles that might give you some pointers :


From what I recall, when it comes to tracking files uploads, the second solution might be a better choice -- if I'm not mistaken, APC stores more stuff in RAM, which could cause some problems.
And here's a question+answer about that specific matter : APC vs pecl uploadprogress