openFilePicker — tiny DOM helper opening the OS file dialog and resolving the chosen File[] ([] on cancel). Pairs with CanvasExtensionApi.ingest:
openFilePicker
File[]
CanvasExtensionApi.ingest
const files = await openFilePicker({ accept: 'image/*', multiple: true });canvasRef.current?.ingest(files); Copy
const files = await openFilePicker({ accept: 'image/*', multiple: true });canvasRef.current?.ingest(files);
Must be called from a user-activation context (a click handler) — browsers block programmatic input.click() otherwise.
input.click()
Optional
<input accept> filter, e.g. 'image/*' or '.csv,text/csv'.
<input accept>
'image/*'
'.csv,text/csv'
Allow multi-select. Default false.
openFilePicker— tiny DOM helper opening the OS file dialog and resolving the chosenFile[]([] on cancel). Pairs withCanvasExtensionApi.ingest:Must be called from a user-activation context (a click handler) — browsers block programmatic
input.click()otherwise.