Empty path when file picked from clicked file picker, but not when dropped? #1216
Unanswered
codelocksdev
asked this question in
Q&A
Replies: 1 comment
-
When you drag a file into an Electron app using react-dropzone, you gain access to the file's path because Electron operates within a Node.js context, which has access to the file system. However, when you select a file using the file selection dialog (click to select), the default behavior aligns with that of a web context, where, for security reasons, the file's path is not exposed. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm posting here first in case this is user error and not a bug. Basically I've got the example code of the hook wrapper running in an electron app.
When I drag a file into the zone, handleDrop receives the files the way you expect and I can inspect that each file has the full absolute path in the
path
attribute. However, the same file, if I click on the drop zone to open the filer picker, handleDrop shows that the files it passes have just the file name forname
and an empty string forpath
.Am I missing something in the settings?
Beta Was this translation helpful? Give feedback.
All reactions