src/vs/base/browser/dom.ts/triggerUpload
export function triggerUpload(): Promise<FileList | undefined> {
	return new Promise<FileList | undefined>(resolve => {

		// In order to upload to the browser, create a
		// input element of type `file` and click it
		// to gather the selected files
		const input = document.createElement('input');
		document.body.appendChild(input);
		input.type = 'file';
		input.multiple = true;

		// Resolve once the input event has fired once
		event.Event.once(event.Event.fromDOMEventEmitter(input, 'input'))(() => {
			resolve(withNullAsUndefined(input.files));
		});

		input.click();

		// Ensure to remove the element from DOM eventually
		setTimeout(() => document.body.removeChild(input));
	});
}