YUI 2: Uploader

YUI Uploader provides file upload functionality that goes beyond the basic browser-based methods. Specifically, the YUI Uploader allows for:

  1. Multiple file selection in a single “Open File” dialog.
  2. File extension filters to facilitate the user’s selection.
  3. Progress tracking for file uploads.
  4. A range of available file metadata: filename, size, date created, date modified, and author.
  5. A set of events dispatched on various aspects of the file upload process: file selection, upload progress, upload completion, etc.
  6. Inclusion of additional data in the file upload POST request.
  7. Faster file upload on broadband connections due to the modified SEND buffer size.
  8. Same-page server response upon completion of the file upload.

Important Issue: Due to a current bug, the current version of uploader.swf hosted on yui.yahooapis.com in the YUI 2.8 branch is NOT compatible with the uploader.js hosted on yui.yahooapis.com. Until the next bugfix release, you can work around this issue by either locally hosting the older version of uploader.swf (available here), or locally hosting the uploader.js and making the following changes to it:

  • On line 509, in swfObj.addVariable("elementID", swfID);, replace “elementID” with “YUISwfId”.
  • On line 512, in swfObj.addVariable("eventHandler", "YAHOO.widget.FlashAdapter.eventHandler");, replace “eventHandler” with “YUIBridgeCallback”.

Important usage notes:

  • Because of security changes in the upcoming Flash Player 10, the UI for invoking the “Browse” dialog has to be contained within the Flash player. Because of that, this new version of the Uploader is NOT BACKWARDS COMPATIBLE with the code written to work with the previous version (it is, however, compatible with Flash Player 9). Do not upgrade to this version without carefully reading the documentation and reviewing the new examples.
  • The Uploader Control should always be served from an HTTP server due to Flash Player’s restricted local security model.
  • The Uploader Control requires Flash Player 9.0.45 or higher. The latest version of Flash Player is available at the Adobe Flash Player Download Center.

Note: The Uploader Control is being released as a beta component. Please refer to the FAQ for what we mean by this designation. We look forward to your feedback in the YUI Forums.

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>