.. _dojox/form/FileUploader: :Status: Up to date :Version: 1.4 :Project owner: Mike Wilcox :Author: Mike Wilcox :Available: since 1.1 .. contents:: :depth: 3 ======================= dojox.form.FileUploader ======================= Basic Description ----------------- Handles multiple file uploading to a server. CDN Note -------- FileUploader does work with the Google and AOL CDNs, but because of cross domain issues, you need to run the SWF locally, and point to its location with djConfig.uploaderPath. Dojo Version 1.2.x ------------------ The FileUploader version 1.1 and 1.2 is no longer supported. FileUploader 1.2 programmatically called the Flash browse() method which Adobe soon after removed for security reasons. Dojo Version 1.3 ---------------- This version is supported but has limitations. It floats the SWF over the styled button, so the CSS is tricky and not always 100% accurate. And this will not work in many cases where the button is in scrolling content, specifically Windows and Linux Firefox. Dojo Version 1.3.2 ------------------ This version is a major upgrade from 1.3, makes CSS placement easier and fixes the scrolling bug. However there is an IE8 bug that was not caught at the time of release. This bug can be patched using the instructions found in the Trac ticket: http://bugs.dojotoolkit.org/ticket/9615 Another bug found is uploading multiple files more than once causes onComplete to fire on every file. It should only fire after all files have uploaded. The fix for this is to use the SWF from the trunk (1.4) in the 1.3.2 release. http://bugs.dojotoolkit.org/ticket/9646 Updating Your Release --------------------- I often suggest to people who are not able to use the 1.3.2 or trunk version of Dojo to copy over the latest uploader files. The involved files would be: - dojox/form/FileUploader.js - dojox/form/resources/uploader.swf - dojox/form/resources/FileUploader.css - dojox/embed/flashVars.js - dojox/embed/Flash.js and optionally: - dojox/form/resources/UploadFile.php - dojox/form/resources/cLOG.php Note that if you are moving these files into Dojo 1.2 or less, you will have to change some of the code in the FileUploader to not use the 1.3 html method dojo.destroy() and replace it with the previous version of dojo._destroyElement() ====================================== FileUploader Functionality 1.3.2 - 1.4 ====================================== FileUploader is now a widget and **DOES** create a button. You do not have to pass a button in. Passing a button is still supported until version 1.5 to maintain backwards compatibility, but it is not recommended. Just create your uploader like any other widget. The button styles are now recreated in Flash, so there is no longer an invisible Flash movie with *wmode=transparent*. This way the Flash button is actually placed inline with the DOM, not floating above it and contstantly resetting its position. The "Windows Firefox clickable bug" should be fixed (and hopefully some Linux problems). The HTML button is created in a new way and it is now inline as is the Flash button. Styling is much easier and more versatile. The process is to create a typical HTML button, with either a button, input, div, or span tag. Button tags work the best. Style the button how you would like it to look in CSS. Then create another class that will append to the class chain to style the button in its hover state. Follow the same procedure for active state (press) and disabled state. Assign the normal class to your button and make the widget either programmtically or with markup. A basic example follows: .. code-block :: css :linenos: .uploadBtn{ border:1px solid #333333; background:url(buttonEnabled.png) #d0d0d0 repeat-x scroll 0px top; font-size:14px; width:201px; height:30px; vertical-align:middle; /* emulates a