Angular simple yet powerfull library to convert file to base64
Run npm install alife-file-to-base64 --save
AlifeFileToBase64Module
to your project and include module in imports sectionimport { AlifeFileToBase64Module } from 'alife-file-to-base64';
@NgModule({
declarations: [
],
imports: [
AlifeFileToBase64Module
],
providers: [],
bootstrap: [AppComponent]
})
<input type="file" alife-file-to-base64 multiple (onFileChanged)="onFileChanges($event)" [(fileModel)]="files" [(rawFileModel)]="rawFiles" />
Santosh Sagar
This module is released under the permissive MIT license