file-selector: react-dropzone v8.2.0 returns only file name in path property in electron, not the path
The files Objects returned on onDrop used to return the entire file path in the path property. Sinse v8.2.0 not any more.
The path property should contain the entire path, just as it does in v8.1.0.
According to https://github.com/react-dropzone/react-dropzone/issues/769#issuecomment-466914018 the issue lies in file-selector.
Last tested with react-dropzone v10.0.4 that according to
$ yarn list --pattern file-selector
yarn list v1.13.0
└─ file-selector@0.1.11
Done in 3.56s.
contains file-selector v0.1.11
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 10
- Comments: 39
Any success in this , same issue I’m also receiving…
In case there is anyone looking for a way to get a full-path in an electron environment, I recommend to try setting
getFilesFromEventtouseDropzoneas mentioned below; https://github.com/electron/electron/issues/44600#issuecomment-2465774352 along withwebUtils.getPathForFileAPI of electron. https://www.electronjs.org/docs/latest/api/web-utils#webutilsgetpathforfilefileYou might as well try to pass
onDrophttps://html.spec.whatwg.org/multipage/indices.html#ix-handler-ondrop directly to the DOM that you usegetRootProps()on, not viauseDropzone:because
webUtils.getPathForFile(file)behaves as follows.@barbalex ok. I may go ahead and close this and you can reopen when you encounter the issue again.
On Sat, Oct 5, 2024, 01:06 steveoh @.***> wrote:
@jmcrthrs please submit a proposal as a new issue and we’ll discuss there. Thanks.
I still observe this with react-dropzone 10.1.5 and file-selector 0.1.12. I had to pin react-dropzone at 8.1.0 to work around the issue.
Even though the source code npm pulled for file-selector appears to include the most recent commit that tries to address the issue, I can still set a breakpoint in minified code which writes over a path property containing the full path and replaces it with the filename only.
Yeah, you’re right. Unfortunately I have to deliver an app next week. Will revisit this issue after that.