Can I get file without file picker dialog?

This is my code. But it working with file picker dialog.
I don’t want open dialog. is there any solution?

      const desktopDomain =;
      const folder = await fs.getFolder({ initialDomain: desktopDomain });
      const designImg = await folder.getEntry(`${imgPath}`);

You can use FS api’s listed in the UXP documentation.This is based on Node.js style File System API.

You can also get an Entry object from a File path/ URL using getEntrywithURL

Hope this helps!

1 Like

it’s not working with this error
Error: Could not find an entry of 'file:<path>'

how can i fix it :face_holding_back_tears: ?

Check you’ve entered the correct path?

you will need manifest version 5 and the correct permissions. Do refer to this thread - getEntryWithUrl not accepting valid path - #3 by Timothy_Bennett

check the requirements posted by other memebers and always start the path with file:/ or file:\\