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.6 out of 46 votes cast

AJAX NEWS
04/01/2007 wxJavaScript : porting wxWidgets to JavaScript.
03/31/2007 DED|Chain - The web developers JavaScript Kit
03/30/2007 Clipperz Crypto Library - a JavaScript library of crypto primitives
03/28/2007 ETech - AJAX Unplugged Slides
03/27/2007 Stripe Generator: ajax powered web 2.0 tool!
03/26/2007 Finally Microsoft joins the OpenAjax Alliance


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.