I'm trying to save file to file system using file upload functionality. Since the file is require for the angular app and not for the backend (rest api - java), I decided to save it in the frontend app which means somewhere inside the assets folder in angular app.
I've install angular-file-saver.
Template code:
<input type="file" name="file-7[]" id="file-7" class="inputfile inputfile-6" (change)="handleFileInput($event.target.files)">
component code:
import { FileSaver } from 'angular-file-saver';
handleFileInput(files: FileList) {
this.imageUpload = files.item(0);
this.imageFileName = this.logoToUpload.name;
// how to use FileSaver here ?
//this.imageUpload doesn't have data or something like this
}
Any idea how to actually save the file in a folder ? thanks.