1

I'm working on a rest Angular-Java application. Client side (Angular), I want the user to be able to choose a folder, to decide where his file (csv format) will be saved. Server side (Java), it will retrieve this path as a string, and export this file to the desired location.

My question is very simple: Angular Side, how to open a file Chooser to load a folder and return its absolute path?

I know how to open a File Chooser with Java, it's very easy. But i don't know how to proceed with Angular. I've just found this trick (but it's to upload a file, not a folder) :

<input type="file"/>
DamCx
  • 1,047
  • 1
  • 11
  • 25
Josept
  • 83
  • 3
  • 14

1 Answers1

3

It's not "possible" with the simple HTML way.

I said possible in quotation marks because it seems there is a way to do it with:

<input type="file" webkitdirectory directory multiple/>

Anyway, scripting seems inevitable.

There is some very good and well-documented libraries for upload handling with Angular like ngx-uploader.

Related topic: Directory Chooser in HTML page

Maxime Lafarie
  • 2,172
  • 1
  • 22
  • 41