I'm trying to open file explorer to select a file and read its contents in JS, but I get Uncaught (in promise) dialog.open not allowed. Plugin did not define its manifest
This is my code so far
const handleOpenFile = async () => {
const selected = await open({
multiple: false,
filters: [{
name: 'Image',
extensions: ['png', 'jpeg']
}]
});
if (selected === null) {
console.log('User Canceled')
} else {
console.log('File Selected')
}
}
Here's my capabilities default.json
{
"$schema": "../gen/schemas/desktop-schema.json",
"identifier": "default",
"description": "Capability for the main window",
"windows": ["main"],
"permissions": [
"path:default",
"event:default",
"window:default",
"app:default",
"image:default",
"resources:default",
"menu:default",
"tray:default",
"shell:allow-open",
"window:allow-start-dragging",
"window:allow-close",
"window:allow-minimize",
"window:allow-toggle-maximize"
]
}
How do I upload files and read the contents, I'm using Tauri V2