Redirect After Upload
Redirect to a different page after all files finish uploading. Common for form submission workflows.
What you should see: the page navigates once every file has finished, not once per file — the redirect is fired from the queue-complete event.
Upload a file to trigger the redirect. This demo redirects back to /Demos after completion.
var uploader = CoreUpload.create('#redirect-uploader', {
uploadUrl: '/api/upload/upload',
multiple: true,
autoUpload: true,
onTaskComplete: function(file) {
console.log('Uploaded: ' + file.name);
},
onQueueComplete: function(files) {
// Redirect after all files are uploaded
window.location.href = '/Demos';
}
});