alife-file-to-base64
Version:
Angular simple yet powerfull library to convert file to base64
44 lines (30 loc) • 1.16 kB
Markdown
file to base64
Run `npm install alife-file-to-base64 --save`
- Import `AlifeFileToBase64Module` to your project and include module in imports section
```javascript
import { AlifeFileToBase64Module } from 'alife-file-to-base64';
@NgModule({
declarations: [
],
imports: [
AlifeFileToBase64Module
],
providers: [],
bootstrap: [AppComponent]
})
```
```html
<input type="file" alife-file-to-base64 multiple (onFileChanged)="onFileChanges($event)" [(fileModel)]="files" [(rawFileModel)]="rawFiles" />
```
- onFileChanged : Will get called when file will get selected by user. It will contain filename, filesize, type and base64.
- fileModel : To set the value of component variable
- rawFileModel : To set the value of component variable for raw files
Santosh Sagar
This module is released under the permissive [MIT license](https://github.com/msg2santoshsagar/alife-simple-rating-star/blob/master/LICENSE)
Angular simple yet powerfull library to convert