Topic: Showing Folder dialog vs File dialog in Chrome
I'm using plupload 2.1.8 and am wondering why - in either the UI or queue widgets - that when I click Add Files and am using Chrome, that the file dialog is displayed, not the folder dialog.
My goal is to allow the user to select a folder, not files. To accomplish this, I made a change to the FileInput function in moxie.js as follows:
Original:
shimContainer.innerHTML = '<input id="' + I.uid +'" type="file" style="font-size:999px;opacity:0;"' +
(_options.multiple && I.can('select_multiple') ? 'multiple' : '') +
(_options.directory && I.can('select_folder') ? 'webkitdirectory directory' : '') + // Chrome 11+
(mimes ? ' accept="' + mimes.join(',') + '"' : '') + ' />';
Mine:
shimContainer.innerHTML = '<input id="' + I.uid + '" type="file" style="font-size:999px;opacity:0;"' +
(_options.multiple && I.can('select_multiple') ? 'multiple' : '') +
(mimes ? ' accept="' + mimes.join(',') + '"' : '') +
(/chrome/i.test(navigator.userAgent) ? 'webkitdirectory directory' : '') + ' />'; // Chrome 11+
In the original, it appears as though the conditionals dictating 'webkitdirectory directory' are false. Can anybody tell me if this is an issue with the moxie.js library, or what the intended behavior is? Before I change moxie.js for my own use, I'd rather make sure first that I'm using it correctly.
Thanks.