Priority Queue
Assign priority levels to files. Higher-priority files upload first, regardless of when they were added to the queue.
What you should see: files uploaded in a priority order you set rather than selection order, so the important file goes first even if it was added last.
Select files to begin.
var uploader = CoreUpload.create('#priority-uploader', {
uploadUrl: '/api/upload/upload',
multiple: true,
autoUpload: false,
concurrent: 1,
onFileAdded: function(file) {
// Assign priority: small files get higher priority
if (file.size < 100 * 1024) {
file.priority = 3; // high
} else if (file.size < 1024 * 1024) {
file.priority = 2; // medium
} else {
file.priority = 1; // low
}
},
onTaskComplete: function(file) {
console.log('Uploaded:', file.name, 'priority:', file.priority);
}
});
document.getElementById('btn-priority-upload').onclick = function() {
uploader.upload();
};