function uploadSupport(selector) {
	let input = $(selector);
	if (!input)
		throw "Element not found: " + selector;
		
	let fileset = new Dataset({
		keymapper: info => info.id
	});
	
	input.change(function() {
		var files = $(this).get(0).files,
			length = files.length,
			array = []
		for (var i = 0; i < length; ++i) {
			var file = files[i];
			file.id = "file-" + new Date().getTime() + "-" + i;
			file.url = (window.URL || window.webkitURL).createObjectURL(file);
			array.push(file);
		}
		fileset.setData(array);
	});
	return fileset;
}