Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Path missing when uploading directory #5

Closed
pippo111 opened this issue Feb 18, 2019 · 2 comments
Closed

Path missing when uploading directory #5

pippo111 opened this issue Feb 18, 2019 · 2 comments

Comments

@pippo111
Copy link

pippo111 commented Feb 18, 2019

When using file selector fromEvent handler on <input {..properties} type='file' webkitdirectory='true' /> full path is missing.

This is example from dropzone event getDataTransferItems={e => fromEvent(e)}:

File(106182)
  lastModified: 1538560178310
  lastModifiedDate: Wed Oct 03 2018 11:49:38 GMT+0200 (czas środkowoeuropejski letni) {}
  name : "audit-with-purge.png"
  size: 106182
  type: "image/png"
  webkitRelativePath: ""
  path: "/test/audit-with-purge.png"

And this is from input onChange event with fromEvent handler:

File(106182)
  lastModified: 1538560178310
  lastModifiedDate: Wed Oct 03 2018 11:49:38 GMT+0200 (czas środkowoeuropejski letni) {}
  name: "audit-with-purge.png"
  size: 106182
  type: "image/png"
  webkitRelativePath: ""
  path: "audit-with-purge.png"

Is there a way to preserve full path ?

EDIT:
In version 0.1.8 onChange actually adds webkitRelativePath, but path is still different and missing full path compared to one from getDataTransferItems

@rolandjitsu
Copy link
Collaborator

@pippo111 I've just released v0.1.9 of file-selector which should use {webkitRelativePath} for {path}if it exists.

@pippo111
Copy link
Author

Just checked it and it works as expected, thank you @rolandjitsu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants