Question

I want to upload multi-files in one time in IE webpage. How can I implement this function in Dojo framework. I have seach some solution, but need install plugin in IE. Are there have perfect method?

Thanks.

Was it helpful?

Solution

Taken as a fraction of my own CMS, this is the way i instantiate the dojox.form.Uploader which has multiple file capeabilities. There are plugins to handle (with 1.7+, also html5) different setups; the easy way to go is to use the flash but it has focus-quirks in -moz and -webkit.

See http://dojotoolkit.org/documentation/tutorials/1.6/uploader/ for reference and simple examples

Beforehand, call require to pull in: dojox/form/Uploader and dojox/form/uploader/plugins/Flash. Whilst plugins/Flash is being declared, it extends the form/Uploader with Base, Flash and HTML5, used as fallback in given order.

    // NB: don't use AMD reference of plugins will not load corrently
 this._fileuploader = new dojox.form.Uploader({
        flashFieldName: 'flashUploadFiles',
        url: this.uploadUrl || 'upload.php', 
        multiple: true,
        swfPath : 'resources/uploader_1.7.2.swf', 
        isDebug: true,
        //                                      force:'flash',
        iconClass: 'dijitFolderOpened', 
        label:'File to upload',  
        id: 'assetsuploader'

});

If you need to understand where 'this' references, see https://github.com/mschr/oocms/blob/master/admin/include/assets.js

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top