Inline Upload
Embed an uploader inline within a text editor toolbar. Attach files directly while composing content.
var uploader = new MultipleUpload(el, {
uploadUrl: '/api/upload',
autoUpload: true,
onTaskComplete: function(task) {
// Add attachment chip to the editor
var chip = document.createElement('span');
chip.className = 'attachment-chip';
chip.textContent = task.name;
attachmentArea.appendChild(chip);
}
});
// Toolbar button triggers file dialog
attachBtn.addEventListener('click', function() {
uploader.openFileDialog();
});