Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

168
Views
Error al cargar archivo a ipfs en react js

Intento cargar una imagen en ipfs en la interfaz de usuario de react js. cuando agrega una imagen usando el botón Agregar, funciona, pero cuando hace clic en el botón Enviar, aparece el siguiente error "Error no detectado (en promesa): entrada inesperada: nulo normalise-candidate-single.js: 16 " y luego para almacenar el hash de retorno de ipfs en hypeledger tela

¿Quién puede ayudarme?

Mi archivo App.js de la siguiente manera
**

 import React, { Component } from 'react'; import './App.css'; import { create } from 'ipfs-http-client' const ipfs = create('http://localhost:5001') class App extends Component { constructor(props) { super(props) this.state = { buffer: null } } captureFile = (event) => { event.preventDefault() //process file for IPFS... const file = event.target.files[0] const reader = new window.FileReader() reader.readAsArrayBuffer(file) reader.onloaded = () => { this.setState(('buffer', Buffer(reader.result))) } } onSubmit = (event) => { event.preventDefault() console.log("submiting the form....") ipfs.add(this.state.buffer, (error, result) => { console.log('Ipfs result', result) if(error) { console.error(error) return } }) } render() { return ( <div> <div className="container-fluid mt-5"> <div className="row"> <main role="main" className="col-lg-12 d-flex text-center"> <div className="content mr-auto ml-auto"> <h2>Change Logo</h2> <form onSubmit={this.onSubmit} > <input type='file' onChange={this.captureFile} /> <input type='submit'/> </form> </div> </main> </div> </div> </div> ); } } export default App;

**

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!