AJAX Upload

In good programming languages there is almost always more than one way to accomplish a goal, PHP is no different. Here we have two very different methods for showing an AJAX progress bar during a file upload which were recently discussed by bloggers Tomas Larsson and Joshua Eichorn.

Tomas describes his approach in Asynchronous file upload with AJAX progress bar in PHP using Prototype combined with PHP to accomplish his effect. Toss in a derivative of MegaUpload for server side receiving and monitoring of the upload, and you have a complete package.

Going a different route, Joshua provides PAFUPMU, a set of classes to show upload progress using HTML_AJAX. With any PHP version newer than 4.3.7 or 5.0 it provides similar functionality to Tomas’ solution. For older versions of PHP you either need to add a patch, or end up with a basic animation and no progress bar (reminded me a bit of KIT from Knight Rider, or the Cylon oscillating faceplate, pick one).

Although somewhat different approaches, both methods do agree on using hidden iframes to allow file uploading.

SOURCE: http://devzone.zend.com

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.