Open a file uploader inside a Bootstrap modal dialog. The uploader initializes
when the modal is shown and uploads work normally within the overlay.
What you should see: the uploader inside a dialog: focus is trapped while open and returns to the trigger on close.
// Initialize uploader when modal opens
modalEl.addEventListener('shown.bs.modal', function () {
AjaxUploader.create(document.getElementById('modalUploader'), {
uploadUrl: '/ajaxupload.axd/upload',
multiple: true,
autoUpload: true,
onTaskComplete: function (file) {
statusEl.textContent = 'Uploaded: ' + file.name;
}
});
});