Style the uploader with Bootstrap classes for seamless integration with Bootstrap-based
applications. Use the JavaScript API for full control over markup and CSS classes.
What you should see: the same uploader wearing Bootstrap's palette and radius via CSS variables. No Bootstrap JavaScript involved.
AjaxUploader.create(element, {
uploadUrl: '/ajaxupload.axd/upload',
multiple: true,
autoUpload: true,
buttonText: 'Choose Files',
buttonClass: 'btn btn-primary',
onFileAdded: function (file) {
// Add Bootstrap list-group-item
},
onTaskProgress: function (file, percent) {
// Update Bootstrap progress bar
progressBar.style.width = clampPercent(percent) + '%';
},
onTaskComplete: function (file) {
// Update badge to "Uploaded"
},
onTaskError: function (file, error) {
// Show Bootstrap alert
}
});