Josept
Josept

Reputation: 83

Upload folder in Angular 4

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"/>

Upvotes: 1

Views: 6608

Answers (1)

Maxime
Maxime

Reputation: 2234

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

Upvotes: 3

Related Questions