This example is a demonstration of the YUI Uploader Control's features.
Note: The YUI 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 YUI Uploader Control requires the uploader.swf Flash file that is distributed as part of the YUI package, in the uploader/assets folder. Copy the uploader.swf to your server and set the YAHOO.Uploader.SWFURL variable to its full path.
Note: This example requires a backend component to receive uploaded files. Download the source for this example below to use on your own PHP server.
When you have the example running on your own server, it should look like the screenshot below:
Start by including all the necessary files for the Uploader and Logger controls:
Next, we set a placeholder for the Uploader Control. The Control has a built-in logging console, so if you set the size of the div to 400x210, you'll see the internal logs of the Uploader.
Next, we'll add two buttons, a "Browse" button, and the "Upload" button. Note that the buttons call the browse()
and upload()
functions, respectively.
We will now initialize the Logger and the Uploader controls. Note that we are also specifying the SWFURL
property for the uploader that's different from the default (./assets/Uploader.swf):
Copyright © 2008 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Copyright Policy - Job Openings