Wizard Upload
Multi-step wizard where one step includes file uploads. Navigate between steps with Next and Back buttons.
1. Details
2. Upload Files
3. Review
// Step 2 contains the uploader
var uploader = new MultipleUpload(el, {
uploadUrl: '/api/upload',
autoUpload: false
});
// On final step submit, trigger upload
submitBtn.addEventListener('click', function() {
uploader.startUpload();
});
Uploads across several steps
In a multi-step form, files are usually gathered on one step and submitted at the end. Uploading as they are chosen means the final step is instant, but it also means files exist on the server before the wizard is finished.
Two things to get right
The uploader must survive stepping back and forth — destroying it on every step change loses in-flight transfers. And an abandoned wizard leaves uploads with nothing pointing at them, so stage them and sweep what is never claimed.