0

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 ..

1 Answers1

1

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

Community
  • 1
  • 1
Pascal MARTIN
  • 395,085
  • 80
  • 655
  • 663
  • cant we do it without can other mods etc... in pure jquery or php? – cuerere Mar 19 '11 at 20:58
  • With PHP 5.2 and PHP 5.3, no, that's not something that can be done using PHP itself *(not adding any extension, I mean)* ;;; With the next version of PHP *(might be called 5.4, maybe)*, it might be possible, see http://schlueters.de/blog/archives/151-Upload-Progress-in-PHP-trunk.html – Pascal MARTIN Mar 19 '11 at 21:01