Oracle Magazine Special offer for AjaxImpact.com Visitors!! Subscribe to Oracle Magazine for Free!
AJAX IMPACT


TUTORIALS
Asynchronous file upload with AJAX progress bar in PHP
03/12/2006 By Thomas Larsson


I wanted to use an asynchronous file upload, like the one on gmail. This means that the file is uploaded in the background, allowing you to still use the page while the file is being uploaded. Since the XMLHttpRequest object doesn’t support file uploads, this had to be done using iframes. Whenever the file input changes, the file is uploaded to the cgi-script in a hidden iframe. The cgi-script writes the total size of the upload and the actual uploaded file to temporary files.



When the upload starts, a Prototype Ajax.PeriodicalUpdater object is created. This object calls a PHP file twice every second using AJAX. The PHP file checks the temporary files while they are being written by the perl file, and returns the total progress in percentage of total upload size. The percentage value is used to set the width of the progress bar.

You can download the complete source code here

   Read More...

 Rate this Ajax Tutorials
 Rating: 6.5 out of 89 votes cast

AJAX NEWS
04/25/2006 ThickBox - Show html pages as well as images in Lightbox
04/24/2006 AgileGallery - AJAX Photo gallery for Picasa
04/24/2006 TeamSlide: Online Ajax-powered Web Presentations
04/23/2006 Google Blogoscoped Chat Released as Open Source
04/18/2006 Windows Live Academic Beta is now live !
04/18/2006 Ask Cheggers - Ajax powered chat bot


INDUSTRY NEWS
05/19/2006 Ajax grabs center stage at JavaOne, By Tony Baer
05/15/2006 Oracle to boost AJAX, Java , By Paul Krill
05/13/2006 Open AJAX Group Drafts Development Plans, By Stacy Cowley
05/13/2006 AJAX Powers Interactive Marketing ASP, By AjaxWorld News Desk
05/12/2006 AJAX Experts Tackle Security, Other Issues , By Darryl K. Taft
05/11/2006 Adobe Releases Spry Framework for AJAX, By AjaxWorld News Desk
More 
       

      © 2008 ajaximpact.com. All rights reserved.