1.4.0 • Published 6 years ago

fuctbase64 v1.4.0

Weekly downloads
164
License
ISC
Repository
github
Last release
6 years ago

Made in Nigeria

fuctBase64

Converting File Uploads To Base64

Using the library.

Installation

install the library using

npm install fuctbase64

or

npm install fuctbase64 --save

to save to your package.json.

Usage

In Angular 2+

// Imports
import { Component } from '@angular/core';

let fileUpload = require('fuctbase64');

// Component Decorator
@Component({
  selector: 'app-file-upload-to-base64',
  template: `<input type="file" name="fileInput" (change)="onFileChange($event)" #fileInput formControlName="fileUpload" />
  <br>
  <div>
    {{fileResult}}  
  </div>`
})

// Component Class
export class FileUploadToBase64Component {
  title = 'app works!';
  fileResult: any;
  constructor(){

  }

  onFileChange(event){
      let result = fileUpload(event).then(result => {
        this.fileResult = result;
      });
      
  }
}

Check out the Plunkr

In Vanilla Javascript

<input id="the-file" name="file" type="file">
let fileUpload = require('fuctbase64');

var fileInput = document.getElementById('the-file');

let fileResult = await fileUpload(fileInput, true);

console.log(fileResult);

Open Issues / Contributions

You can open issues for things which you thing I did wrong. Or better you can contribute to this project. We will happy to have your contributions. Thank you

License

1.4.0

6 years ago

1.3.8

6 years ago

1.3.7

6 years ago

1.3.6

6 years ago

1.3.5

6 years ago

1.3.4

6 years ago

1.3.3

6 years ago

1.3.2

6 years ago

1.3.1

6 years ago

1.3.0

6 years ago

1.2.1

6 years ago

1.2.0

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago