-1

How to read full path on uploaded files?

I tried to drag and drop many folders to upload at a time.

However, I could only see the filename from FileList object.

How could I get the file path in this case?

If read file paths is not allowed, can we allow users to upload a .zip file which contains multi-level folders and unzip it on the frontend. Can we get the file_path information by doing so?

enter image description here

newBike
  • 14,385
  • 29
  • 109
  • 192

1 Answers1

1

You can't, you can't get any information from the user system.

That would be a potential security and privacy breach. Plus there's no reasons for you to need it.

Morphyish
  • 3,932
  • 8
  • 26
  • Is there any SPEC defined for this topic? – newBike Aug 02 '19 at 18:12
  • You can find more [here](https://en.wikipedia.org/wiki/JavaScript#Security). At some point [this API](https://developer.mozilla.org/en-US/docs/Web/API/File_and_Directory_Entries_API) was added to some browsers, but I'm not sure if it's still available and probably very limited if it is. – Morphyish Aug 02 '19 at 18:17
  • Thanks for this correct info – newBike Aug 05 '19 at 23:37