Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-file-base64

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-file-base64

React Component for Converting File to base64

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5.1K
decreased by-5.95%
Maintainers
1
Weekly downloads
 
Created
Source

React File Base64

React Component for Converting Files to base64. It's based on Dev Mozilla Website

DEMO

Install

You can import react-file-base64.js to your react component file like this and process it with your preprocessor.

You can install it via NPM

npm install react-file-base64

Usage


import React from 'react';
import ReactDOM from 'react-dom';

import FileBase64 from 'react-file-base64.js';

class App extends React.Component {

  constructor() {
    super()
    this.state = {
      files: []
    }
  }

  // Callback~
  getFiles(files){
    this.setState({ files: files })
  }

  render() {
    return (
      <FileBase64
        multiple={ true }
        onDone={ this.getFiles.bind(this) } />
    )
  }

}


ReactDOM.render(<App />, document.getElementById("app"))

Props

multiple (Boolean)

Is your component support multiple file?

onDone (Function)

Callback Function When all files have been proceed

Thank You for Making this useful~

Let's talk about some projects with me

Just Contact Me At:

License

MIT Copyright (c) 2016 - forever Naufal Rabbani

Keywords

FAQs

Package last updated on 03 May 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc